-
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
[Umbrella] Improving compiler adoption and dogfooding story #18783
Comments
Consuming C# compiler from CoreXTMsBuild 14
Note: this doesn't work with MsBuild 15
(Thanks Zack Runner for the instructions and package) |
Dogfooding Roslyn on VS 2017Important note: there is a known issue with un-installing this. Use at your own perils. We are working towards a solution. Installation instructions
To get back to a clean state:
|
Relates to #13361 (letting users update the compiler in CLI) |
My list of contacts:
|
Consuming C# compiler from ASP.NETA number of people on stackoverflow are reporting trouble adopting C# 7.0 in their ASP.NET and ASP.NET Core projects. This often has strange symptoms, where the IDE accepts the new syntax (no squiggles), but building the solution or F5 produce errors in the Output window. This is caused by a mismatch between the built-in compiler (used by VS) and the compiler pulled in as a nuget package by ASP.NET projects. The To troubleshoot this, open the "Manage NuGet packages" UI, then select the "Browse" tab. Search for "Microsoft.Net.Compilers" and look at the installed version and the newest available version. The fix for ASP.NET:
The fix for ASP.NET Core 1.0:
services.AddMvc().AddRazorOptions(options =>
options.ParseOptions = new CSharpParseOptions(LanguageVersion.CSharp7)); For ASP.NET Core 2.0, there should be no need to set Razor options. It uses the language version from the project (the Razor views and the code-behind use the same language version). This works with "default" and "latest", but there is a parsing bug with handling "7.1" (tracking issue). Note: if you want to use C# 7.0 tuples in your project, you'll also need to install Where to find
|
Consuming C# compiler from CLIAs far as I can tell, upgrading the
|
Remove Microsoft.Net.Compilers.netcore package from build. Microsoft.Net.Compilers.netcore needs to be updated for netstandard dotnet/roslyn#12674 agocke commented on Oct 3 2016 @onovotny Do you think you could give a little background on your use case for this? This package was a bit of a hack to just get things in the right place for .NET CLI so I'd be curious how other people are using it. HOWTO use C# 7 with .NET Core dotnet/roslyn#13361 svick commented on Aug 27 2016 edited I've managed to figure out a way, but it's super convoluted (possibly unnecessarily). [Umbrella] Improving compiler adoption and dogfooding story dotnet/roslyn#18783 See the various sections below for adopting new versions of the compiler (including nightlies) in various contexts (VS, ASP.NET, etc). This is still work-in-progress. As we shift to point release model, it is increasingly important that we make it easy for customers (external and internal to Microsoft) to adopt new versions of the compiler, including previews. Host Users can upgrade? Upgraded by default? Allows dogfooding Plan . . . Powershell I don't think so . . . Hey! C'mon now. PowerShell user trying to eat your dogfood here. One who is full spurns honey; but to the hungry, any bitter thing is sweet. - Prv 27:7 Sigh. PowerShell life.
Consuming local C# compiler in MSBuildIf you have a local build of the C# compiler, you can pass its path to |
@jcouv Sorry to ping such an old thread, is there any updated guidance on using daily builds with Visual Studio? I use It looks like Roslyn Insiders for VS Next hasn't been updated since 2017 unless there's a new location that I'm not aware of. (The VSIX stuff is still on MyGet, right? Only NuGet moved to Azure DevOps?) Back in June I had a somewhat workable solution by manually installing the Roslyn Language Services, Roslyn Expression Evaluators, and Roslyn Compilers packages. But I remember getting them to install was troublesome and it seemed like I was shoving a square peg in a round hole. It also caused my 2019 Preview install to violently combust upon updating to the next preview came out. |
@PathogenDavid Unfortunately, the best I would recommend is just staying on recent previews. They are not as fresh as daily, but they are less than a month old... :-/ Alternatively, you can set up from a local build. |
That's too bad, but thanks for confirming! I actually briefly looked into using a local build with |
@PathogenDavid There is no consistently tested mechanism to install the IDE features. Basically you are installing Visual Studio N + 1 bit on Visual Studio N. You can look at the artifacts that are produced by CI That zip file will contain a script that attempts to install the latest VSIX into our chosen VS (you will need to launch with |
Thanks for the info! I really appreciate it. Horribly fail does seem to be accurate: Well...maybe not horribly. Despite the angry golden bars, it actually worked at a in my quick test. (No error squiggles, but code completion works!) I mostly wanted this to confirm IDE bugs weren't already fixed before I report them (and if it worked well, there's been fixes I'd definitely appreciate having with a preview 3+n.) This might be good enough for the former, but not the latter. |
Those gold bars are about the OOP server not being updated but we fall back to doing everything in-proc for this case so things should still just work™ |
Ah, I was kinda surprised it still mostly worked after an error like that but that makes sense. Thanks for the insight! |
See the various sections below for adopting new versions of the compiler (including nightlies) in various contexts (VS, ASP.NET, etc). This is still work-in-progress.
As we shift to point release model, it is increasingly important that we make it easy for customers (external and internal to Microsoft) to adopt new versions of the compiler, including previews.
Then there's also internal adoption and dogfooding: building VS code itself, building corefx, building corefxlab, dogfooding with .NET Native, etc
There is also the
Microsoft.CodeDom.Providers.DotNetCompilerPlatform
package, which has some relationship to ASP.NET.The text was updated successfully, but these errors were encountered: