-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cannot publish self-contained worker project referencing another #10902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I found one can get around the error by specifying |
This is also happening to me when creating a self-contained console that references another console. Having |
This issue should be moved to https://github.com/dotnet/sdk repo |
I had the same problem with NetCore 3.1 This was not working:
Fixed by removing
|
Same issue with NetCore 3.1. Temporary workaround as suggested by @markmnl Add this to *.csproj file. Change RIDs as you wish |
Update build config due to dotnet/sdk#10902
The various combinations of @gimmi 's suggestion worked for me. Thanks! |
Perhaps it will be helpful:
|
This is still happening in .NET 5. Any fixes? Specifying the RuntimeIdentifier in the .csproj file is NOT a solution because if you develop on Windows, then deploy for Linux, you'll need to have two .csproj files for each OS, NOT GOOD. |
I have a similar/related issue, when i build for linux (Docker/Linux/Raspberry) I get: ld not load file or assembly 'LibUsbDotNet, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c677239abe1e02a9'. The system cannot find the file specified. Also notice for linux it doesn't emit the libusbdotnet.dll, Tip for @darkguy2008 - you can put variables into your build so you can use 1 project file. |
@darkguy2008 property groups support conditions: |
You can specify multiple targets like so: as per the docs "Multiple RIDs can be defined as a semicolon-delimited list in the project file's element. " |
- Workaround for .NET bug dotnet/sdk#10566, dotnet/sdk#10902
Duplicate of #10566 |
Add RuntimeIdentifier win-x64 in both projects P1 & P2 results in the following error message: |
When you change frameworks or runtimeidentifiers in the .csproj file, make sure to delete the bin & obj folders and recompile, I've gotten that before and it gets fixed when I remove those folders to make a clean build. Also check your .vscode/tasks.json file if you have any. |
Thank you and @doug62 , I ended up using project variables as suggested, just forgot to get back to you guys here :) |
Thanks but same error message even with bin & obj folders deleted. The steps to reproduce:
|
This issue still exists in the .NET 6 SDK. |
I also have this issue. If I try to create an application
|
I had the same issue with a test project referencing an ASP.NET Core web project. This could be worked around with With .NET 7 SDK, this appears to be fixed for my projects, and I do not need the workaround anymore. |
…ult if the '--runtime' flag is specified and the github issue (dotnet/sdk#10902) suggested doing it.
When trying to publish single file exe for worker projects get error runtime identifier is required, but it was!
This happens when referencing another core 3 console project.
Steps to reproduce
dotnet new worker
dotnet add reference
.NET Core SDK (3.0.100)
es).
The text was updated successfully, but these errors were encountered: