-
Notifications
You must be signed in to change notification settings - Fork 676
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
Properly discover .NET SDK path #768
Comments
After discussing this with the MSBuild team, it seems that the recommended solution would be to use the Microsoft.Build.Runtime package when it's available. This will include MSBuild.exe + the basic targets and tasks needed to build a .NET Core project. The work to create this package is tracked here: dotnet/msbuild#1039. |
@DustinCampbell Is there any workaround that would tide me over until that issue is resolved? I’m currently getting the following error in my csproj-based solution. It is preventing me from getting any IntelliSense for my csproj projects.
|
Are these MSBuild-based .NET Core projects (which are still being developed), or are they regular desktop .csproj projects? |
Yes, they are .NET Core projects. I find that while the MSBuild-based Core infrastructure is still under development, projects using it build just fine. |
I find that if I symlink
|
Don't symlink that folder. Instead, here's what you can do:
{
"msbuild": {
"msbuildextensionspath": "/usr/local/share/dotnet/sdk/1.0.0-preview3-003618"
}
} Finally, close and restart VS Code with your project. Good luck! Note that I typed that directly into GitHub without verifying on my Mac, so your mileage might vary slightly. |
@DustinCampbell Unfortunately, I cannot currently test this due to OmniSharp/omnisharp-roslyn#643. If you or anyone else could help me resolve that issue, I would be very appreciative. |
I'm digging in on that issue as well. |
@DustinCampbell I've followed the above instructions on my Windows 10 machine. (Due to the issue linked above I still have not yet gotten this to work on my Mac.) Unfortunately, OmniSharp still fails to parse the csproj files; this time it gives me this error:
|
At the start of the OmniSharp Log, did it verify that it started the omnisharp that you built and specified in "omnisharp.path"? Also, on Windows, you might specify "net451" rather "netcoreapp1.0" in the path. |
Trying the net451 version of OmniSharp does indeed give me better results. |
With your steps outlined above followed, VSCode does indeed search for the |
Yes, this is because the feature is simply not implemented yet. All of this is in active development. 😄 |
Is this an issue in OmniSharp proper, or should I open an issue/PR on |
Nope. The reason this isn't working like you'd like is because of this. You're in the right spot. It's just that the work has only just started. |
I have some good news to report: Your process outlined above work perfectly — on my Mac. On the Windows PC I still get the above errors. I suppose this is only a bug related to my Windows PC’s unique setup, though, as my Mac opens the 15.0-based projects without complaint. |
Glad to hear it. It's definitely still a work-in-progress though. 😄 |
The original plan for this backlog item is no longer relevant. The extension now installs OmniSharp along with a copy of MSBuild to handle csproj proejcts. |
I still got this issue in 1.10.0
|
When running a design-time build with MSBuild, OmniSharp needs to specify the .NET SDK as the MSBuildExtensionPath. Otherwise, the MSBuild targets imported by .NET Core csproj projects can't be found. Discovering this should happen in one of two ways:
The text was updated successfully, but these errors were encountered: