-
Notifications
You must be signed in to change notification settings - Fork 4.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
VS15.5: The "SharedCompilationId" parameter is not supported by the "Csc" task (ASP.NET Web Forms projects) #24542
Comments
Still very interested in this issue being resolved. ;) |
As a general comment it's disappointing that 2 of the last 3 minor releases (15.5 and previously 15.3 - see https://github.com/dotnet/corefx/issues/23229) have broken our (not particularly exotic) solution. This sort of issue means we need to be very careful about updating Visual Studio as there is no way to downgrade. |
Tagging @agocke who likely has some context on SharedCompilationId. |
@jaredpar this could be node reuse, combined with using the Microsoft.Net.Compilers package in only some of the projects in the solution. Does that sound possible to you? |
That sounds like what is happening here. I'm not quite sure how to combat this tough. It sounds like in this scenario there are multiple versions of the compiler being brought into a single solution via NuGet and ASP Codedom Provider. When that happens it's pretty much a race condition as to which C# compiler / msbuild task is going to win. Not sure there is really anything in MSBuild that we can leverage here. CC @rainersigwald for input. |
I think I can confirm that: If I uninstall nuget Microsoft.Net.Compilers I no longer get |
The same thing is happening in Visual Studio 15.6 Preview 4, which appears to include a preview of Rosyln 2.7.0 ( This time it's the As before, this only occurs with the ASP.NET Web Forms projects in our solution. All projects in the solution reference version |
I have the same issue in Visual Studio 15.6 Preview 7. Unlike Quppa, this is in several projects of a solution — some WinForms and some WPF; some VB.NET and C#. I haven't been able to figure out what they have in common (possibly referencing COM code?). None of them appear to use the Microsoft.Net.Compilers package. |
Seems similar to #25257 |
I hope Microsoft.Net.Compilers version 2.7.0 will be pushed in the near future so we can work around this issue - until then, we can't update to Visual Studio 15.6. |
@Quppa can you elaborate on how this is blocking? The only scenarios where we think this can occur is when a project tries to override the version of the compiler that comes with Visual Studio. If you're waiting for 2.7 to be released to upgrade to 15.6 then the simpler solution would be to no longer try and override the compiler version here. Then it would just work. |
@jaredpar That's a fair point - we don't actually need the We reference |
In VS Preview, explicitly referencing In VS non-Preview, however, I am oddly not encountering the issue, even though both versions appear to be using 2.7.0-beta3. |
That may be the root of the issue. Referencing the CodeDom package is the equivalent of referencing the Microsoft.Net.Compilers package as concerns the issues around EmbedAllSources and SharedCompilationId. I've poked again asking for the new packages to be published. Longer term though I think we're going to need a feature from MSBuild here to work around this. |
Thanks for following this up. Deleting |
@Quppa I'm worried that either that will break when you update something else, or that NuGet restore will just bring down old files (or, if you're pulling from VS, a new VS update will just overwrite the old files). I may be misremembering how it works, but could you just also delete the Microsoft.CodeDom.Providers.DotNetCompilerPlatform package? Wouldn't that just cause the Web Forms project to pull in the machine compiler, thus resolving the versioning difference problem? |
@agocke I mean the We rely on |
That depends on Microsoft.Net.Compilers (>= 2.4.0), so 2.6.1 should satisfy that requirement. Have you tried adding that package reference explicitly? |
Sure, but I thought Come to mention it, could the parameter possibly be part of 2.6.1? I haven't actually tried that version yet - I just assumed I needed 2.7.0 since that's the build included in VS15.6. I'll try it out. |
You're probably right. VS 15.6 final appears to ship with 2.7.0-beta3, and the build parameter was committed Dec 8 and merged Jan 4. 2.6.1, OTOH, has some backported fixes, but was tagged on Dec 5, before the commit. However, there's now a tag for 2.7.0-beta3 (as of just ten hours ago), so they're probably about to push a newer NuGet package. It strikes me as odd that a final VS would ship with a beta compilers package? |
I did wonder about that, too, but VS15.5 shipped with 2.6.0-beta3, so it's not without precedent. I just tried and failed to make a minimal repro with a new Web Forms project, so I'll take the opposite approach of deleting code from our existing codebase until it works. |
Updating Microsoft.CodeDom.Providers.DotNetCompilerPlatform to 1.0.8 and Microsoft.Net.Compilers 2.7 (available as of 8hrs ago) solved this for me. |
Here's a fairly minimal Probably the key lines are:
and
|
@saschanm, @Quppa thanks for getting that minimal repo together. That confirms my suspicion that this is an issue in the DotNetCompilerPlatform package. I think we should move this issue over to the https://github.com/aspnet/RoslynCodeDomProvider repository as this is where that package is built. |
Migrating issue to aspnet/RoslynCodeDomProvider#33 |
Upon further investigation the issue is that our
The above import is included for a new ASP.NET Web Forms project, and I'm not quite sure how we ended up without it. This might have been a casualty of our conversion from Creating a new project produces a
and at the bottom:
|
This fixes an issue where an error was occuring due to overriding of the visual studio compiler version. See dotnet/roslyn#24542
Install-Package Microsoft.Net.Compilers -Version 2.8.2 |
Apologies if this is not valuable. It doesn't reference the Microsoft.Net.Compilers package at all. Just Microsoft.AspNetCore.App and Microsoft.VisualStudio.Web.CodeGeneration. I was not able to build from VS2017, but 'dotnet run' worked fine! The workaround was to "Install-Package Microsoft.Net.Compilers -Version 2.8.2" but this seems pretty ugly and hopefully a real solution will be forthcoming. |
@mrnams thank you, works like a charm |
After updating to Visual Studio 15.5, the two ASP.NET Web Forms projects in our solution are failing to build with the following errors:
29>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn\Microsoft.CSharp.Core.targets(137,10): error MSB4064: The "SharedCompilationId" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property.
29>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Roslyn\Microsoft.CSharp.Core.targets(84,5): error MSB4063: The "Csc" task could not be initialized with its input parameters.
I can work around the issue by removing the line SharedCompilationId="$(SharedCompilationId)" from the Csc element in Microsoft.CSharp.Core.targets.
Every project in our solution is using the latest version of Microsoft.Net.Compilers (2.4.0) and the web projects are using the latest version of Microsoft.CodeDom.Providers.DotNetCompilerPlatform (1.0.8). Our ASP.NET MVC and ASP.NET Web API projects are building without issue.
A new Web Forms project with the same Nuget compiler packages installed doesn't exhibit the issue.
This issue has been moved from https://developercommunity.visualstudio.com/content/problem/162531/vs155-the-sharedcompilationid-parameter-is-not-sup.html
VSTS ticketId: 534553
These are the original issue comments:
Bobby Cannon on 12/6/2017, 06:19 PM (54 days ago): I'm having the same issue. My local roslyn is newer (2.6 beta) than what I'm referencing via nuget (2.4 latest stable).
Bobby Cannon on 12/6/2017, 06:21 PM (54 days ago): My web projects references rosyln 2.4 latest stable, however I think VS 15.5 installed 2.6 (beta3) and now I get an error of "The SharedCompilationId parameter is not supported by the csc task"
David Warner on 12/6/2017, 07:28 PM (54 days ago):
Good tip regarding Microsoft.Net.Compilers 2.6.0-beta3 - updating to that package also resolves the issue. I'd rather not be forced to update to a pre-release version of the compiler just to make our solution work in a stable release of Visual Studio, however.
David Warner on 12/6/2017, 07:06 PM (54 days ago):
@Bobby Cannon Are you also seeing this only for Web Forms projects? What's strange is that the same Microsoft.CSharp.Core.targets reference is included in our other CSPROJ files and they're fine.
Candy Zhang [MSFT] on 12/6/2017, 10:13 PM (54 days ago):
We appreciate you taking the time to report this problem. We are currently prioritizing problems that are impacting a broad set of our customers, so we may not be able to investigate this one immediately. We know this problem is important to you, so we will continue to monitor it.
David Warner on 12/7/2017, 03:34 PM (53 days ago):
Is there any indication of when a stable version of Microsoft.Net.Compilers 2.6.0 will be released?
David Warner on 12/10/2017, 07:01 PM (50 days ago):
It looks like 2.6.0 was published soon after I wrote my last comment. We'll target this version to work around the VS15.5 issue.
These are the original issue solutions:
(no solutions)
The text was updated successfully, but these errors were encountered: