dotnet/sdk

Not created folder runtimes NET 5.0.5

nurbat opened this issue · 18 comments

dotnet build -c Release
dotnet publish --no-build -c Release -f net5.0 --self-contained true -o BuildRelease

изображение

And when I try to run through the console with the command ./MyProject.exe returns an error that the file was not found at the path runtimes/etc...

And if you just try to launch it with a double click, nothing happens at all

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

Tagging subscribers to this area: @vitek-karas, @agocke, @CoffeeFlux, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

dotnet build -c Release
dotnet publish --no-build -c Release -f net5.0 --self-contained true -o BuildRelease

изображение

And when I try to run through the console with the command ./MyProject.exe returns an error that the file was not found at the path runtimes/etc...

And if you just try to launch it with a double click, nothing happens at all

Author: nurbat
Assignees: -
Labels:

area-AssemblyLoader-coreclr, untriaged

Milestone: -

Can you please post the error message you get when you run it from command line?

What kind of app is this? ASP.NET, Win UI, console... ?

What kind of app is this? ASP.NET, Win UI, console... ?
Console

Can you please post the error message you get when you run it from command line?
Later, The error was standard that a specific manifest, and that a certain dll is missing in the runtimes folder

Is this dll clrcompression.dll by any chance?

there is no such dll in the folder

I use steamcmd to upload to the steam store, after which this problem occurs. If you just copy it to another location, even on another PC. It works, and when I upload files via steamcmd, it starts swearing.

I tried to upload the files to a zip archive, upload to steam after unpacking, the program works, but if you try to download the files without unpacking, the program stops working and swears that there is no folder runtimes

there is no such dll in the folder

That's quite interesting. But my question was specifically about the message. What does it say exactly?

Could you also provide a binary log (gathered using msbuild /bl or dotnet -bl)?

--self-contained false
dotnet publish -c Release -f net5.0 -r win-x64 --self-contained false -o PublishRelease -bl
msbuild.zip

--self-contained true
dotnet publish -c Release -f net5.0 -r win-x64 --self-contained true -o PublishRelease -bl
msbuild.zip

I'm guessing that the upload to steam removes .pdb files - but in this case the file is listed as required by the app, so it fails without it. As a workaround you could upgrade to Microsoft.Data.SqlClient.SNI.runtime version 2.1.1 which doesn't seem to have this problem (it doesn't ship the pdb in the package).

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

Moving this to SDK since this seems to be an SDK problem (if there is even one). I don't know if SDK should include pdb files in .deps.json in this case.

the pdb is in place, apparently that's not the problem. This problem should be solved, but this SNI file does not have a pdb even in the assembly

As far as I can tell the SNI is a native library.

Used the Microsoft.* library

This bug appears to directly contradict what is stated in the documentation:

If the app uses a NuGet package that has platform-specific implementations, dependencies for all platforms are copied to the publish\runtimes{platform} folder.

I may have found a workaround but will need to test this further:
Running

dotnet publish -c Release -o myPublishDir -r linux
dotnet publish -c Release -o myPublishDir -r osx
dotnet publish -c Release -o myPublishDir -r win
dotnet publish -c Release -o myPublishDir                 (not sure if this is needed)

copies the native libraries that should end up in runtimes/**/* to myPublishDir and as long as their names don't collide, this should work?
At least my very basic CI test passed, but I'll have to run more thorough testing to determine if I can trust this workaround.