-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Roslyn does not load ASP.NET Core 2 documents #21660
Comments
Looking at the Worskpace after loading the solution, I have an error message on the Diagnostics property:
|
Unfortunately, MSBuildWorkspace does not support .NET Core projects very well yet. We're working on it but don't have an estimate of when it will be done. |
@DustinCampbell is there any other approach I could be taking? Maybe a nightly build or executing through command line? |
There's nothing available yet (work quite literally began this week 😄). There are some tricks you can try to workaround but I have no idea how well they might work. For the particular error above you might consider setting the "MSBuildSdksPath" environment variable to the location of the appropriate .NET Core SDK on your machine before creating the Environment.SetEnvironmentVariable("MSBuildSdksPath", @"C:\Program Files\dotnet\sdk\2.0.0"); |
@DustinCampbell I tried with both 2.0.0 and 2.0.1 preview, didn't make a difference. Notice, though, that before setting that variable, it is not set (GetEnvironmentVariable returns null). Would it possible to run dotnet msbuild with Process or something alike? |
"MSBuildSdksPath" is an override that MSBuild looks for. If set, it will try and use it when handling the "Sdk" attribute. Honestly, it was a bit of a long shot to see if it would work.
I'm not sure what you mean by this. |
@DustinCampbell I was referring to something like this: https://docs.microsoft.com/en-us/dotnet/core/tools/cli-msbuild-architecture but running from C#. Is there any property I can check to see whether the variable is being used at all? |
Unfortunately, no.
Sure, I just didn't understand how it's relevant. MSBuildWorkspace uses MSBuild inproc. It's not related to the .NET CLI at all. |
@DustinCampbell What is the current status? I still have the same problem. Is there any known solution or workaround to get access to the semantic model of a solution (*.sln) having .NET Core projects? |
@BjarkeMeier did you try Microsoft.Build.Locator?
|
@AlexeiScherbakov , thanks a lot. It works. This issue should be closed with your answer as the solution. |
I have similar problem, and it takes MANY days before I found answer. It's
funny, that problem is solved by MS long time ago, but this feature has
advanced usage (for example I use it for custom codegenerator), and only
few persons know about it. I subscribed for about 5 similar issues with
roslyn to find answer :-)
пт, 15 нояб. 2019 г., 11:43 BjarkeMeier <notifications@github.com>:
… @AlexeiScherbakov <https://github.com/AlexeiScherbakov> , thanks a lot.
It works. This issue should be closed with your answer as the solution.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21660?email_source=notifications&email_token=ACCDWO7GIDVY54J42WUZGC3QTZOK7A5CNFSM4DX4GDC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEEXBRY#issuecomment-554266823>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCDWO2A6T7PMYNPY7DTI5DQTZOK7ANCNFSM4DX4GDCQ>
.
|
Version Used: Visual Studio 15.3.1
Steps to Reproduce:
Expected Behavior:
The memoryStream, when written to a file, contains the correct DLL which, when read, has the types defined in the ASP.NET Core project (like Program, Startup, Controllers, etc).
Actual Behavior:
The project has HasDocuments = false and the generated DLL does not contain any type. See this SO question for further details
The text was updated successfully, but these errors were encountered: