Closed stevenvolckaert closed 1 year ago
I have the same problem. The workaround suggested by @stevenvolckaert works
Looks like they never fixed 17.5. https://github.com/dotnet/roslyn/pull/66367#issuecomment-1440720451
Either switch your install to 17.4.4 LTSC or use the 17.6.0P1.0 Preview editions...
I haven't had time to evaluate the suggested fix above but that may also work - if those lines are in the common,msbuild includes, I'm not sure why they aren't pulled in already...
Thank you for your suggestion @CZEMacLeod!
Adding property CommandLineArgsForDesignTimeEvaluation
to the .csproj
files works for now, though. When 17.6.0 is available I'll remove it and report back here.
When 17.6.0 is available I'll remove it and report back here.
Hopefully with https://github.com/dotnet/roslyn/pull/67000 this will be fixed in 17.5.1.
This is just as an FYI, because I don't have an offending version of Visual Studio installed to confirm.
It appears that the CommandLineArgsForDesignTimeEvaluation
property is being set in the Microsoft.CSharp.Core.targets
file delivered as part of Roslyn. The particular flavor that's actually used during build time is dependent on project config and how build is triggered
Microsoft.Net.Compilers.Toolset
(version 4.4.0 and greater) - Whenever project being built includes reference to this packageMicrosoft.Net.Compilers.Toolset
package) Microsoft.Net.Compilers.Toolset
package)This Sdk by default will include a reference to the Microsoft.Net.Compilers.Toolset
package (currently 4.3.0). So one more potential work around until projectsystem does not "Require" this property could be:
If you are currently allowing this Sdk to include the default packages (you HAVE NOT overriden the default behavior by setting <ExcludeASPNetCompilers>true</ExcludeASPNetCompilers>
), then you could set this Sdk's MicrosoftNetCompilersToolset_Version
property to 4.4.0 instead of this Sdk's current default of 4.3.0 with something like:
<PropertyGroup>
<MicrosoftNetCompilersToolset_Version>4.4.0</MicrosoftNetCompilersToolset_Version>
</PropertyGroup>
Alternatively if you are currently not allowing this Sdk to include the default packages (you HAVE overriden the default behavior with <ExcludeASPNetCompilers>true</ExcludeASPNetCompilers>
), then you can manually add a PackageReference to one of the later Microsoft.Net.Compilers.Toolset
packages with something like:
<ItemGroup>
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.4.0" PrivateAssets="All" />
</ItemGroup>
Seems like they fixed it with 17.5.1
I confirm; updating to Visual Studio 17.5.1 fixes this issue.
See Visual Studio 17.5.1 release notes for more information.
@leusbj I think the next release of the SDK should bump Microsoft.Net.Compilers.Toolset
to 4.4.0 by default to ensure this doesn't break on e.g. build servers etc.
@leusbj I think the next release of the SDK should bump
Microsoft.Net.Compilers.Toolset
to 4.4.0 by default to ensure this doesn't break on e.g. build servers etc.
@CZEMacLeod Would like this change to the 'MicrosoftNetCompilersToolset_Version' incorporated with the pending changes to support CPM? Or since the CPM isn't as straight forward, do this change as a standalone change, and back that change into the PR for the CPM Stuff?
@leusbj V4.0.88 includes the new version (V4.5.0 in fact). I felt that getting a couple of small changes in to fix some of the outstanding issues was a good bet, then we can do the CPM work as a separate task.
I just upgraded my Visual Studio Professional 2022 instance to version 17.5.0, which was released on 21 February 2023.
My
MSBuild.SDK.SystemWeb/4.0.82
projects do not load any more:The log file shows:
I could workaround this by adding property
CommandLineArgsForDesignTimeEvaluation
to my.csproj
files (source):