-
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 returns Error MSB4062 "Microsoft.Build.Tasks.SGen" task could not be loaded from the assembly #10255
Comments
We have a similar issue, where we are getting the following build error
We have a Console Application running on netcoreapp2.1 the uses a library project that does WCF for a SOAP service, this SOAP service requires an XMLSerializers.dll for operation. But when setting the Environment data:
|
This is occurring again in SDK 3.1.1. My co-worker has 3.0.1 as the latest on his machine and does not have this issue. |
We're having this issue with a However, if we build in Visual Studio 2019 instead of from the command line via We did some investigation and it seems the problem is that the version of the Version numbers for reference: |
Has anyone figured out how to resolve this issue? We would really like to be able to build our code from a dotnet core sdk 3.1 docker container but this is preventing us from doing so. |
If you want to use
The error message should be much clearer, though. I moved dotnet/msbuild#3583 into the next release; hopefully we can get that going soon. |
We have an ASP.NET Core 2.1 application using the full framework (4.7) that references a .NET 4.6 class library that make SOAP calls (WebReference). Since 2016 we've been able to run
dotnet publish
in our CI process with no issues with VS 2017. Once we installed VS2019 on the same host this stopped working.We suspect it's a problem with the
dotnet
CLI deciding which version of MSBuild to run.We understand that there are some work-arounds that seem to get past it such as setting
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
(which we don't want to do) and it seems that running MSBuild directly instead ofdotnet publish
works but we wanted to report this issue here.Steps to reproduce
dotnet publish --configuration Release -out c:\temp\foo
Here is a repo with an example.
Expected behavior
The publish operation works
Actual behavior
This error is thrown:
More info
It seems that running MSBuild works however and the publish output is almost identical compared to when
dotnet publish
was ran in the past:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild" /t:Publish /p:Configuration=Release;Out-Dir=C:\temp\foo
According to our build logs, the last successful time
dotnet publish
ran (before VS 2019 was installed), it reported usingMicrosoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
you'll notice in the output above it reports using16.0.450+ga8dc7f1d34 for .NET Core
.If
dotnet publish
is not the recommended way of publishing such configurations please provide guidance.Environment data
dotnet --info
output:The text was updated successfully, but these errors were encountered: