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

Build failing due to empty ToolDepsJsonGeneratorProject value #190

Open
MiguelAlho opened this issue Oct 8, 2019 · 5 comments
Open

Build failing due to empty ToolDepsJsonGeneratorProject value #190

MiguelAlho opened this issue Oct 8, 2019 · 5 comments

Comments

@MiguelAlho
Copy link

Hi. We have a WPF project that uses the Sdk, and we recently made a few changes to both the project (update from 1.6.68 to 2.0.54), but also some upgrades on the build agent (a Team City agent ). Agent-wise, we recently updated the VS instance we have on it , to have access to some tools that are included.

After this change (not applied on all agents yet) we started to get the following error:

´´´
C:\Users<user>.nuget\packages\msbuild.sdk.extras\2.0.54\Sdk\Sdk.props(16,5): error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form. [path-to-project.csproj]
´´´

I started investigating, and this only occurs on the agent where we upgraded the VS instance. We have an agent that did not have this upgrade that can still build the project correctly (15.9 compiler).

From what I can see, in the ´sdk.props´ file and the log, our value for $(ToolDepsJsonGeneratorProject) is empty (and code only goes through this because $(MicrosoftWindowsDesktopSdkPath) is also empty/unset. Is there any SDK elements (like windows SDK) or some VS feature that needs to be installed to have this set correctly?

Our cake-based build process is specifically detecting that it is an extras project and is using the VS msbuild instead of the .net core version (though our solution mixed both types of projects).

@mfkl
Copy link

mfkl commented Oct 9, 2019

Hitting this as well with vmImage vs2017-win2016 and "MSBuild.Sdk.Extras": "2.0.54" global json and .NET Core SDK 3.0.x. Updating to the windows-2019 vmImage fixes it for me.

@clairernovotny
Copy link
Collaborator

@MiguelAlho I'm not completely sure what's going on, ToolDepsJsonGeneratorProject should be set early by the .NET Core SDK. If you're using VS 2019, do you have 16.3 on it and do you have the .NET Core workload installed?

@mfkl
Copy link

mfkl commented Oct 10, 2019

Have a consistent repro here if you're interested @onovotny videolan/libvlcsharp#71 (comment)

@azchohfi
Copy link
Contributor

azchohfi commented Dec 4, 2019

I'm hitting the same error when targeting .Net Core 3.1.100.

@jwdb
Copy link

jwdb commented Feb 19, 2020

The issue was solved for me by changing the SDKversion in the global.json from 3.0.100 to 3.1.100. I did not have .Net Core 3.0.100 installed, so it might be happening the targeted SDK version is not installed?

me-johnomar pushed a commit to me-johnomar/Caliburn-Micro that referenced this issue Jun 20, 2022
Issue #648 did not state the exact error that occurred when opening the solution but if the SDK is missing (as described in novotnyllc/MSBuildSdkExtras#190) the solution fails to load.

This is an obscure error message that is hard to search for within this repository. The modification adds a simple and prominent FAQ that explains the problem and how to fix it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants