Skip to content
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

Ionide stuck at project load when project file imports a non-dotnet targets file #1972

Open
ronnieholm opened this issue Dec 28, 2023 · 0 comments

Comments

@ronnieholm
Copy link

Within a .NET 4.8 project where foo.fsproj is in SDK format, if at the bottom of foo.fsproj I import

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" />

Ionide is stuck with "Project loading" in the status bar and no relevant output in the Ionide or Ionide: MSBuild output windows.

If however I open a C# project which itself doesn't import Microsoft.WebApplication.targets, but references a project which does, the C# output window shows:

[Error - 10:23:29 AM] [LanguageServerProjectSystem] Failure while loading c:\Users\rh\source\repos\identityprovider\IntegrationTests\IntegrationTests.csproj: The imported project "C:\Program Files\dotnet\sdk\8.0.100\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\8.0.100\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" is correct, and that the file exists on disk.

In the C# output window, the path to Microsoft.WebApplication.targets is wrong and may be what's confusing Ionide:

C:\Program Files\dotnet\sdk\8.0.100\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets

. Microsoft.WebApplication.targets is actually located at

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets

The error in the C# output window doesn't prevent a C# project from loading and shouldn't prevent Ioniode either.

Machine info

  • OS: Windows Server 2022
  • .NET SDK version: 8.0.0 (and .NET 4.8).
  • Ionide version: 7.16.1

Additional context

Importing Microsoft.WebApplication.targets in a .NET 4.8 project is required for Kudu deploys to succeed.

@ronnieholm ronnieholm changed the title Ionide stuck at project load when project file imports a non-dotnet target Ionide stuck at project load when project file imports a non-dotnet targets file Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant