DocFX Version Used: Latest release with mono 5.4.1.6
Template used: Default
Steps to Reproduce:
Expected Behavior:
It works.
Actual Behavior:
mono ../../Downloads/docfx.exe metadata ✓ 1123 23:36:43
[18-01-16 10:36:59.052]Info:Config file docfx.json found, start generating metadata...
[18-01-16 10:37:05.369]Info:[ExtractMetadata]Loading projects...
[18-01-16 10:37:05.820]Warning:[ExtractMetadata](/home/mgysin/RiderProjects/lamada/lamada/lamada.csproj)Workspace failed with: [Failure] Msbuild failed when processing the file '/home/mgysin/RiderProjects/lamada/lamada/lamada.csproj' with message: Operation is not supported on this platform.
[18-01-16 10:37:05.873]Warning:[ExtractMetadata]Project '/home/mgysin/RiderProjects/lamada/lamada/lamada.csproj' does not contain any documents.
[18-01-16 10:37:05.891]Info:[ExtractMetadata]Cache for /home/mgysin/RiderProjects/lamada/lamada/lamada.csproj in /home/mgysin/RiderProjects/lamada/lamada/obj/xdoc/cache/final/741176259 is corrupted, rebuild...
[18-01-16 10:37:05.891]Info:[ExtractMetadata]Generating metadata for each project...
[18-01-16 10:37:05.991]Info:[ExtractMetadata]'/home/mgysin/RiderProjects/lamada/lamada/lamada.csproj' keep up-to-date since '1/16/2018 8:59:24 PM', cached intermediate result '/home/mgysin/RiderProjects/lamada/lamada/obj/xdoc/cache/obj/yigx11l9.c61' is used.
[18-01-16 10:37:06.039]Warning:[ExtractMetadata]No metadata is generated for lamada.
[18-01-16 10:37:06.054]Info:Completed in 6894.4386 milliseconds
Build succeeded with warning.
[18-01-16 10:37:06.056]Warning:[ExtractMetadata](/home/mgysin/RiderProjects/lamada/lamada/lamada.csproj)Workspace failed with: [Failure] Msbuild failed when processing the file '/home/mgysin/RiderProjects/lamada/lamada/lamada.csproj' with message: Operation is not supported on this platform.
[18-01-16 10:37:06.056]Warning:[ExtractMetadata]Project '/home/mgysin/RiderProjects/lamada/lamada/lamada.csproj' does not contain any documents.
[18-01-16 10:37:06.056]Warning:[ExtractMetadata]No metadata is generated for lamada.
3 Warning(s)
0 Error(s)
I am having the same problem with a dotnet core project on linux.
docfx v2.30
mono 5.0.0 (tried 5.4.1.6 as well though same issue)
msbuild 15.3
If I generate the documentation for docfx-seed on the other hand, everything works fine.
Is this a general incompatibility with linux+netcoreapp2.0 at the moment?
Should've supported since https://github.com/dotnet/docfx/pull/2268
Hi @ManuelGysin @trevex is it possible for you to provide a minimum failed project for me to repro and take a look?
Related reference https://github.com/dotnet/roslyn/issues/20848#issuecomment-340294584
I uploaded the basic initial project I used to test this: https://github.com/trevex/CueX
I also installed the lastest stable mono and dotnet-sdk on OSX and get the same error:
nik@localhost ~/Development/CueX/Documentation [3:48:43]
> $ docfx metadata [±master ●●]
[18-01-19 02:52:36.847]Info:Config file docfx.json found, start generating metadata...
[18-01-19 02:52:37.114]Info:[ExtractMetadata]Loading projects...
[18-01-19 02:52:37.938]Warning:[ExtractMetadata](/Users/nik/Development/CueX/CueX.API/CueX.API.csproj)Workspace failed with: [Failure] Msbuild failed when processing the file '/Users/nik/Development/CueX/CueX.API/CueX.API.csproj' with message: Operation is not supported on this platform.
[18-01-19 02:52:38.048]Warning:[ExtractMetadata](/Users/nik/Development/CueX/CueX.Core/CueX.Core.csproj)Workspace failed with: [Failure] Msbuild failed when processing the file '/Users/nik/Development/CueX/CueX.Core/CueX.Core.csproj' with message: Operation is not supported on this platform.
...
Exporting MSBUILD_EXE_PATH changes the error message though to:
nik@localhost ~/Development/CueX/Documentation [3:56:16]
> $ export MSBUILD_EXE_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/MSBuild.dll && docfx metadata
[18-01-19 02:56:45.728]Info:Config file docfx.json found, start generating metadata...
[18-01-19 02:56:46.006]Info:[ExtractMetadata]Loading projects...
[18-01-19 02:56:46.785]Warning:[ExtractMetadata](/Users/nik/Development/CueX/CueX.API/CueX.API.csproj)Workspace failed with: [Failure] Msbuild failed when processing the file '/Users/nik/Development/CueX/CueX.API/CueX.API.csproj' with message: The type initializer for 'Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer' threw an exception.
[18-01-19 02:56:46.896]Warning:[ExtractMetadata](/Users/nik/Development/CueX/CueX.Core/CueX.Core.csproj)Workspace failed with: [Failure] Msbuild failed when processing the file '/Users/nik/Development/CueX/CueX.Core/CueX.Core.csproj' with message: The type initializer for 'Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer' threw an exception.
...
EDIT: I am gonna test setting MSBUILD_EXE_PATH on the linux machine later as well
UPDATE: The output on linux is the same also throwing The type initializer for 'Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer' threw an exception.
UPDATE: The same docfx.json builds fine on appveyor
I just used a plain project created with Rider for this.
MSBUILD_EXE_PATH overwrite causes the same problem here like in the comment above.
Reproed in https://travis-ci.org/docascode/docfx.test, will take a further look into it.
MSBuild assembly throws this exception when new MSB.Evaluation.ProjectCollection();, need a further look.
MSBUILD_EXE_PATH while code sets MSBuild_EXE_PATH.... In Linux, case sensitivity matters.Root cause identified for The type initializer for 'Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer' threw an exception:
System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows) returns True under mono with Assembly System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0 while returns False under mono with Assembly System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0.... doubt if mono does not support 4.0.2 yet...
One workaround is to specifically use System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0., and use app.config to redirect all the assembly references back to 4.0.1.0. But I doubt if that is a correct fix....
@vicancy
getting
The type initializer for 'Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer' threw an exception:
System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)
under macos. i didnt understand the workaround you provided, could you elaborate? where is app.config?
Hi @jaroslaw-weber The workaround is talking about a code level fix. You might wait until we release a fix.