-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dotnet publish --no-build error MSB4018 ComputeManagedAssemblies #12803
Comments
@sfoslund I added the |
I had the same issue, both locally and in ADO pipeline with |
I'm having the same problem after upgrading from dotnet build
dotnet publish --no-build --self-contained --runtime win-x64
C:\Program Files\dotnet\sdk\5.0.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(225,5): error MSB4018: The "ComputeManagedAssemblies" task failed unexpectedly. [C:\Acme\Acme.csproj]
C:\Program Files\dotnet\sdk\5.0.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(225,5): error MSB4018: System.IO.FileNotFoundException: Could not find file 'C:\Acme\obj\Release\net5.0\win-x64\Acme.dll'. [C:\Acme\Acme.csproj]
C:\Program Files\dotnet\sdk\5.0.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(225,5): error MSB4018: File name: 'C:\Acme\obj\Release\net5.0\win-x64\Acme.dll' [C:\Acme\Acme.csproj]
C:\Program Files\dotnet\sdk\5.0.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(225,5): error MSB4018: at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) [C:\Acme\Acme.csproj]
... Strangely, I noticed that it works as expected if when using dotnet build --runtime win-x64
dotnet publish --no-build --self-contained --runtime win-x64 And this is when I noticed the publish task is looking for files in a runtime-specific folder, which presumably it wasn't doing for .NET Core 3.1. |
Note that the |
I have a similar, maybe related issue. I have native dependencies such as MKL. I run the following:
This results in the runtimes folder to contain the native dependencies for all the possible runtimes. The resulting artifacts are in my case 6 times bigger than they should be because of that. what I would like to do is run
But it fails with
I'm not even sure why it's using a Maybe the |
Hi,
regarding to the issue #9552 I am encountering the following error:
I am trying to publish a dotnet core 3.1. cli with a project reference to a netstandard2.0 library.
Steps to reproduce
I created a sample .net core 3.1 console app which I've uploaded, so you can reproduce the issue.
dotnet restore
dotnet build --no-restore -c Release
dotnet test --no-build -c Release
dotnet publish "Dotnet31ConsoleApp/Dotnet31ConsoleApp.csproj" --no-build -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true -p:ReadyToRun=true -p:ReadyToRunShowWarnings=true -p:Version=1.0 -o publish/win
Expected behavior
The project is successfully published in the given output path "publish/win".
Actual behavior
I am getting the following error stack trace:
Environment data
dotnet --info
output:λ dotnet --info
.NET Core SDK (gemäß "global.json"):
Version: 3.1.302
Commit: 41faccf259
Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19041
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.302\
Host (useful for support):
Version: 3.1.6
Commit: 3acd9b0cd1
.NET Core SDKs installed:
3.1.301 [C:\Program Files\dotnet\sdk]
3.1.302 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Additional information
I used all those fancy new options, but with just
dotnet publish "Dotnet31ConsoleApp/Dotnet31ConsoleApp.csproj" --no-build -c Release -r win-x64
I am receiving the following error output:The text was updated successfully, but these errors were encountered: