Not working with .NET core .csproj files with Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props not found error
See original GitHub issueI have made a sample repository for reproducing the problem available at https://github.com/dlech/docfx_project.
I am using DocFX v2.18.4 installed from the chocolatey package on Windows 10 with VS 2017 Preview (15.3 preview 2).
This is basically the default docfx init
with a C# project added to the src/
directory (dotnet new classlib -o src/
) using dotnet2.0 preview tooling.
When running docfx
, I get the unhelpful warning (see #1686):
[17-06-09 03:41:02.022]Warning:No metadata is generated for Core.
Running more than once results in an extra warning:
[17-06-09 04:19:08.622]Warning:Cache for C:/Users/david/Documents/GitHub/Dandy.Core/Dandy.Core.sln in C:\Users\david\Documents\GitHub\Dandy.Core\obj\xdoc\cache\final\-262745601 is corrupted
[17-06-09 04:19:08.622]Warning:No metadata is generated for Core.
After cherry-picking #1738, I get the additional message:
[17-06-09 04:23:49.102]Warning:Workspace failed with: [Failure] Msbuild failed when processing the file 'C:\Users\david\Documents\GitHub\Dandy.Core\src\Core.csproj' with message: The imported project "C:\users\david\Documents\GitHub\docfx\src\docfx\bin\Debug\net46\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. C:\Users\david\Documents\GitHub\Dandy.Core\src\Core.csproj
So, it appears that DocFX is now expecting to find the .NET SDK in a folder relative to the docfx.exe
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:34 (11 by maintainers)
Top Results From Across the Web
MSBuild: imported project ... Sdk.props was not found
I get for all 51 C# projects: error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Sdks ...
Read more >Unable to Build My Solution using command
InvalidProjectFileException: The imported project “C:\Program Files (x86)\MSBuild\2.0\Microsoft.Common.props” was not found.
Read more >The SDK 'Microsoft.NET.Sdk' specified could not be found. ...
Since Visual Studio 2022 updated from version 17.4 to 17.5, I couldn't load my project. and get the error "The SDK 'Microsoft.NET.
Read more >NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >NET Core 6 projects not able to run with SAST (#360734)
When a customer with a .NET core 6 project runs a SAST scan with security-code-scan , it reports an unknown assembly in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
These two environment variables appear to resolve this issue - at least I get no more warnings in the output.
Hi @dealdiane , according to Microsoft/msbuild#1697 . there is a gap between msbuild tool and .NET core SDK build, so you have to install Visual Studio 2017 (not Build Tools but the full VS) on your build server as current workaround…