docfx
docfx copied to clipboard
Dependent child projects running .NET Standard cause DocFX to fail.
Operating System: Windows
DocFX Version Used: 2.58.0 (but really dev synced to HEAD).
Template used: default
Steps to Reproduce:
-
git clone https://github.com/jamiehankins/ExtractMetadataBug.git
-
cd ExtractMetadataBug
-
msbuild ExtractMetadataBug.sln -t:Rebuild -p:Configuration=Release -p:Platform="Any CPU"
Expected Behavior: Builds with 0 errors, 0 warnings.
Actual Behavior:
[21-07-03 02:52:30.874]Warning:[MetadataCommand.ExtractMetadata](c:/git/ExtractMetadataBug/MainProject/MainProject.csproj)Workspace failed with: [Warning] Found project reference without a matching metadata reference: c:\git\ExtractMetadataBug\SupportLibrary\SupportLibrary.csproj
If you edit the two project files and change the TargetFramework to net5.0
, it builds (and runs DocFX) fine with no warnings.
Our codebase has to be usable from both .NET Core and .NET Framework, so we're stuck with .netstandard2.0
for now.
MSBuild wants to see reference assemblies when it enumerates dependencies. .NET 5.0 creates these by default.
I don't think there's a code-change to be made in DocFX, but there should be some documentation.
All I had to do was add this to my dependencies:
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
Thanks for answering your own question, your question and answer was what I needed, worked like a charm.