Error: The "UseDependentUponConvention" parameter is not supported by the "CreateCSharpManifestResourceName" task
See original GitHub issueIssue Description
OmniSharp.MSBuild.ProjectLoader
fails when trying to load a solution that contains a project with reference to another project.
Due to this problem, the IntelliSense does not work!
Looks like this change is not available in the “omnisharp-vscode” built-in MSBuild.
I removed the UseDependentUponConvention="$(EmbeddedResourceUseDependentUponConvention)"
lines from the following files:
~/.vscode/extensions/ms-vscode.csharp-1.21.7/.omnisharp/1.34.7/omnisharp/.msbuild/15.0/Bin/Microsoft.CSharp.CurrentVersion.targets
~/.vscode/extensions/ms-vscode.csharp-1.21.7/.omnisharp/1.34.7/omnisharp/.msbuild/Current/Bin/Microsoft.CSharp.CurrentVersion.targets
So, the VS Code loaded the solution with no errors and everything worked!
Steps to Reproduce
- Create a solution with 2 projects (with the main project referencing the subproject:
<ProjectReference Include="(...).csproj" />
); - Open the Visual Studio Code in Ubuntu (>= 18.04);
- Check the warning message: Some projects have trouble loading. Please review the output for more details.
- Try to use the Go to definion feature.
Expected Behavior
The Visual Studio Code loads the projects with no error and the IntelliSense works.
Actual Behavior
The Visual Studio Code loads the project (with troubles) and the IntelliSense does not work.
Logs
OmniSharp log
(...)
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
FAILURE: Could not locate '/(...)/.vscode/extensions/ms-vscode.csharp-1.21.7/.omnisharp/1.34.7/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Tasks.Core.resources.dll'.
[fail]: OmniSharp.MSBuild.ProjectLoader
The "UseDependentUponConvention" parameter is not supported by the "CreateCSharpManifestResourceName" task. Verify the parameter exists on the task, and it is a settable public instance property.
[fail]: OmniSharp.MSBuild.ProjectLoader
The "CreateCSharpManifestResourceName" task could not be initialized with its input parameters.
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/(...)/workspace/(...)/mySubProject.csproj'.
/(...)/workspace/(...)/mySubProject.csproj
/(...)/.vscode/extensions/ms-vscode.csharp-1.21.7/.omnisharp/1.34.7/omnisharp/.msbuild/Current/Bin/Microsoft.CSharp.CurrentVersion.targets(110,15): Error: The "UseDependentUponConvention" parameter is not supported by the "CreateCSharpManifestResourceName" task. Verify the parameter exists on the task, and it is a settable public instance property.
/(...)/.vscode/extensions/ms-vscode.csharp-1.21.7/.omnisharp/1.34.7/omnisharp/.msbuild/Current/Bin/Microsoft.CSharp.CurrentVersion.targets(107,9): Error: The "CreateCSharpManifestResourceName" task could not be initialized with its input parameters.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /(...)/workspace/(...)/myMainProject.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/(...)/workspace/(...)/myMainProject.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/(...)/workspace/(...)/myMainProject.csproj'
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /(...)/workspace/(...)/mySubProject.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Update project: myMainProject
[warn]: OmniSharp.MSBuild.ProjectManager
Ignoring previously failed to load project '/(...)/workspace/(...)/mySubProject.csproj' referenced by 'myMainProject'.
[warn]: OmniSharp.MSBuild.ProjectManager
Expected project reference /(...)/workspace/(...)/mySubproject.csproj to be already loaded for project myMainProject
(...)
C# log
Environment information
VSCode version: 1.40.1 C# Extension: 1.21.7
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26Runtime Environment: OS Name: ubuntu OS Version: 19.10 OS Platform: Linux RID: ubuntu.19.10-x64 Base Path: /usr/share/dotnet/sdk/3.0.100/
Host (useful for support): Version: 3.0.0 Commit: 95a0a61858
.NET Core SDKs installed: 3.0.100 [/usr/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
cpptools | ms-vscode | 0.26.2-insiders |
csharp | ms-vscode | 1.21.7 |
gitlens | eamodio | 10.2.0 |
todo-tree | Gruntfuggly | 0.0.162 |
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
thanks I suspect the problem is related to embedded resources or resx (do you have any?) - not project-to-project references (there are plenty of integration tests for that, and if that didn’t work, then really nothing would work).
on macOS we use msbuild from Mono 6.4.0, it could be that it was built before the commit that added the property. you could try to install mono 6.6.0 preview (https://www.mono-project.com/download/preview/) and see if it helps/
The problem is not reproduced anymore after version 1.21.11.