smartcomponents icon indicating copy to clipboard operation
smartcomponents copied to clipboard

Error downloading onnxruntime

Open egarim opened this issue 1 year ago • 3 comments

When I add the following package to my project

I got the following error when I build from visual studio

Severity Code Description Project File Line Suppression State Error MSB3027 Could not copy "C:\Users\xarig.nuget\packages\microsoft.ml.onnxruntime\1.17.0\runtimes\ios\native\onnxruntime.xcframework\ios-arm64_x86_64-simulator\onnxruntime.framework\Headers\onnxruntime_session_options_config_keys.h" to "bin\Debug\net6.0\runtimes\ios\native\onnxruntime.xcframework\ios-arm64_x86_64-simulator\onnxruntime.framework\Headers\onnxruntime_session_options_config_keys.h". Exceeded retry count of 10. Failed. XafSmartComponents.Blazor.Server C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 4911

the error does not happend if you build the project from the console using "dotnet build" or "dotnet run", I'm using windows 10 as OS

egarim avatar Mar 20 '24 19:03 egarim

That's very odd. I don't know why the ONNX package would be trying to copy iOS-related assets to your build output.

Are you building an ASP.NET Core application, or is this a MAUI project?

If you can give repro steps (as in, exactly what project to create, using which SDK version, and what steps to take to get this error) I would definitely investigate.

SteveSandersonMS avatar Mar 21 '24 10:03 SteveSandersonMS

is a Blazor application

egarim avatar Mar 22 '24 00:03 egarim

Thanks for answering, but unfortunately we would need more detailed repro steps in order to investigate. The components work as expected in many other Blazor apps so we would need to figure out what's different about your app or about your dev machine setup.

Since you're saying the problem is specific to Visual Studio in your case (and does not happen when building from CLI) it might be there is a problem with your Visual Studio installation. You might need to uninstall it, and reinstall the latest version.

Sorry I can't give you more precise guidance without more details that could point at the cause!

SteveSandersonMS avatar Mar 22 '24 09:03 SteveSandersonMS

I'll close due to lack of info - I guess you probably resolved it yourself already.

SteveSandersonMS avatar Apr 15 '24 12:04 SteveSandersonMS

Hi @SteveSandersonMS

I have experienced the same issue. The reason is the maximum path length, at least when compiling on Windows.

The NuGet package of Microsoft.ML.OnnxRuntime contains all the header files required by the supported OSes. See the runtimes folder in https://nuget.info/packages/Microsoft.ML.OnnxRuntime/1.18.1 Those paths can be quite long, e.g. runtimes/ios/native/onxxrumtime.xcframework/ios-arm64_x86_64-simulator/onnxrumtime.framework/Headers/onnxruntime_session_options_config_keys.h has 142 characters.

My guess why it's only an issue in Visual Studio, is that the dotnet CLI enables Long Path support, while VS is restricted to the "old" 260 MAX_PATH limit.

thoemmi avatar Jul 16 '24 09:07 thoemmi

@thoemmi That makes it sound like a problem specifically in the Microsoft.ML.OnnxRuntime package. Would you consider reporting the issue to the maintainers of that package? I think the repo is at https://github.com/microsoft/onnxruntime/

SteveSandersonMS avatar Jul 16 '24 09:07 SteveSandersonMS

FYI: enabling long paths (Registry setting to enable long paths) did the trick. I can now compile successfully

thoemmi avatar Jul 25 '24 15:07 thoemmi