Comments (7)
You probably have to update the version of Roslyn being pulled in. You might be able to specify in your project a newer version of Microsoft.Net.Compilers.Toolset
.
from msbuild.sdk.systemweb.
I've added the latest version of that package, but the error remains.
<PackageReference Update="Microsoft.Net.Compilers.Toolset" Version="4.0.1" />
from msbuild.sdk.systemweb.
The SDK pulls in
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.8.0" PrivateAssets="All"/>
automatically - as well as
<PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="3.6.0" />
unless you set the property ExcludeASPNetCompilers
to true.
If you are using Microsoft.Build.CentralPackageVersions
you can actually set these versions in your central packages file.
Because of the order, if you place it in your project file, I'm pretty sure your
<PackageReference Update="Microsoft.Net.Compilers.Toolset" Version="4.0.1" />
happens before the include so there will be nothing to update at that point.
If you move that to Directory.Build.targets
it should work though.
Alternatively use
<PropertyGroup>
<ExcludeASPNetCompilers>true</ExcludeASPNetCompilers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.0.1" PrivateAssets="All"/>
<PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="3.6.0" />
</ItemGroup>
I will also look at potentially updating the default version pulled in by the SDK to 4.0.1.
I'm not entirely sure if there is an updated version of the CodeDom Providers, which means the langversion available in your compiled pages might not support C# 10.
from msbuild.sdk.systemweb.
Using version 4.0.66 with <MicrosoftNetCompilersToolset_Version>4.0.1</MicrosoftNetCompilersToolset_Version>
gets rid of that error 👍. Thank you for your time and investigation.
Sadly I'm running into another issue which I hoped to get rid off by switching to Sdk-style project in the first place. My project builds fine on Windows (old-style csproj), but fails to build on macOS/Mono with the following error. I don't understand why this happens as MyLibrary
builds just fine.
Assembly 'MyLibrary' with identity 'MyLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Net.Http' with identity 'System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Warning MSB3277 : Found conflicts between different versions of "System.Net.Http" that could not be resolved.
There was a conflict between "System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
"System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
References which depend on "System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [/Users/bouke/.nuget/packages/system.net.http/4.3.4/ref/net46/System.Net.Http.dll].
/Users/bouke/.nuget/packages/system.net.http/4.3.4/ref/net46/System.Net.Http.dll
Project file item includes which caused reference "/Users/bouke/.nuget/packages/system.net.http/4.3.4/ref/net46/System.Net.Http.dll".
System.Net.Http
References which depend on "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/4.8-api/System.Net.Http.dll].
/Users/bouke/Developer/MyProject/MyLibrary/bin/Debug/net48/MyLibrary.dll
Project file item includes which caused reference "/Users/bouke/Developer/MyProject/MyLibrary/bin/Debug/net48/MyLibrary.dll".
/Users/bouke/Developer/MyProject/MyLibrary/bin/Debug/net48/MyLibrary.dll
from msbuild.sdk.systemweb.
That brings back some bad memories. I think this SO answer might help:
https://stackoverflow.com/a/51424880/2225808
from msbuild.sdk.systemweb.
Yes bad memories indeed. I thought I left those behind by migrating to PackageReference and auto binding redirects. And it has been working fine for years now on Windows (regular Framework 4.8).
Thanks for the suggestion. My project already has a transitive dependency on System.Buffers 4.5.1, and making that dependency explicit doesn't resolve the build warning. I suspect the bug is with Mono not resolving the System.Net.Http dependencies similar to framework v4.7.2 or 4.8, but I have yet to find proof of this.
from msbuild.sdk.systemweb.
@Bouke Since the update to 4.0.66 deals with the c#10 issue, do you mind closing this?
If there is something specific to the SDK which affects your binding redirects / package resolving process perhaps open a new issue about it.
It should be noted, that using this on Linux/Mac with Mono is not really a supported scenario for this SDK and you are in for many other difficulties I suspect.
from msbuild.sdk.systemweb.
Related Issues (20)
- Environment-specific Web.config files do not end up in a deployment package HOT 2
- GenerateBindingRedirects task failed unexpectedly with System.UnauthorizedAccessException HOT 8
- Add support for Central Package Management HOT 2
- Provide `CommandLineArgsForDesignTimeEvaluation`? HOT 4
- AutoGenerateBindingRedirects causes output xml attributes to change order randomly HOT 1
- Central Package Management - Default Package Restore Failure HOT 9
- "ASP.NET Core Module is required" when running in Visual Studio HOT 5
- MSBuild.SDK.SystemWeb/4.0.82 projects do not load in Visual Studio 2022 17.5.0 HOT 10
- Setting RoslynToolPath to allow ASPX compilation with newer language versions HOT 8
- Launch Profiles editor no longer works in the latest versions of Visual Studio (17.5+)
- MSBuild.SDK.SystemWeb.RazorLibrary does not support GeneratedBindingRedirectsAction feature
- Microsoft.CodeDom.Providers.DotNetCompilerPlatform should use the latest version dependant on the target framework version HOT 1
- error : Could not open Source file: Could not find file 'Web.config;Web.config' HOT 1
- IIS Express profile launchSettings.json does not add environment variables in the iisexpress.exe process HOT 5
- Configuration-specific Web.configs added to project even if they don't exist
- GenerateBindingRedirects task emits warning without code - unable to suppress HOT 3
- Broken intellisense and aspnet warnings on WebForms projects HOT 26
- VsCode's new C# DevKit fails to launch HOT 7
- Auto added aspnetcore handler and "module" HOT 2
- Add support for autogenerated binding redirects that are not source controlled HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msbuild.sdk.systemweb.