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

metadata command not working on Linux (Mono) #1708

Closed
dlech opened this issue May 28, 2017 · 7 comments
Closed

metadata command not working on Linux (Mono) #1708

dlech opened this issue May 28, 2017 · 7 comments
Labels
bug A bug to fix dotnet Generate .NET API reference docs fundamental: xplat Cross-platform support

Comments

@dlech
Copy link
Contributor

dlech commented May 28, 2017

Functional impact

docfx metadata is not usable on Linux.

Minimal repro steps

Expected result

Metadata should be created.

Actual result

If fails to create any data...

[17-05-28 12:35:53.204]Info:Config file docfx.json found, start generating metadata...
Could not load signature of Microsoft.CodeAnalysis.SymbolSearch.SymbolSearchUpdateEngine+RemoteControlService:CreateClient due to: Could not load file or assembly 'Microsoft.V
isualStudio.RemoteControl, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.VisualStudio.RemoteControl, Versi
on=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>
Could not load signature of Microsoft.CodeAnalysis.SymbolSearch.IRemoteControlService:CreateClient due to: Could not load file or assembly 'Microsoft.VisualStudio.RemoteContro
l, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.VisualStudio.RemoteControl, Version=14.0.0.0, Culture=neu
tral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>
[17-05-28 12:35:53.682]Warning:Error opening solution /home/david/work/junk/docfx-seed/src/SampleClass1/SampleClass1.sln: Could not resolve the signature of a virtual method.
Ignored.
[17-05-28 12:35:53.698]Warning:No metadata is generated for .
[17-05-28 12:35:53.729]Info:Completed executing in 393.7172 milliseconds.

Further technical details

According to the error message, Microsoft.VisualStudio.RemoteControl is missing. This does not sound like something that would be included in Mono, so it either needs to be included in the docfx.zip or the dependency should be removed.

@vicancy vicancy added dotnet Generate .NET API reference docs fundamental: xplat Cross-platform support priority-2 labels Jun 1, 2017
@vicancy vicancy added bug A bug to fix priority-1 and removed priority-2 labels Jun 2, 2017
@dlech
Copy link
Contributor Author

dlech commented Jun 6, 2017

FYI, I have just tried DocFX on Windows 10 using the choco package and the seed repo with basically the same results (can't generate metadata), so it does not seem that this problem is restricted to just Linux/Mono.

PS C:\Users\david\Documents\Junk\docfx-seed> docfx metadata --loglevel Verbose
[17-06-06 08:03:31.112]Info:Config file docfx.json found, start generating metadata...
[17-06-06 08:03:33.573]Verbose:Successfully generated metadata C:/Users/david/Documents/Junk/docfx-seed/src/SampleClass1
/SomeVbClass/obj/xdoc/cache/obj for SomeVbClass
[17-06-06 08:03:33.657]Verbose:Successfully generated metadata C:/Users/david/Documents/Junk/docfx-seed/src/SampleClass1
/CatLibrary/obj/xdoc/cache/obj for CatLibrary
[17-06-06 08:03:33.674]Verbose:Successfully generated metadata C:/Users/david/Documents/Junk/docfx-seed/src/SampleClass1
/BaseClass/obj/xdoc/cache/obj for BaseClass
[17-06-06 08:03:33.689]Warning:No metadata is generated for SomeVbClass,CatLibrary,BaseClass.
[17-06-06 08:03:33.704]Info:Completed executing in 2326.677 milliseconds.


Build succeeded with warning.
[17-06-06 08:03:33.721]Warning:No metadata is generated for SomeVbClass,CatLibrary,BaseClass.
        1 Warning(s)
        0 Error(s)

@dlech
Copy link
Contributor Author

dlech commented Jun 6, 2017

On further inspection, on Windows, it seems to be a different issue. You have to manually specify the source code files. So, no problem on Windows other than the error message is not informative.

@dlech
Copy link
Contributor Author

dlech commented Jun 6, 2017

Now that I understand the separate issue I was seeing on Windows (with the same warning message), I was able to get things working on Linux/Mono. I just grabbed the .dll from https://www.nuget.org/packages/Microsoft.VisualStudio.RemoteControl/ and threw it in with the others from the .zip file.

@vicancy
Copy link
Contributor

vicancy commented Jun 7, 2017

Hi @dlech Are you able to generate documents under mono after the missing dll is added? In my local machine, mono docfx fails with with no metadata generated.

@dlech
Copy link
Contributor Author

dlech commented Jun 7, 2017

There are two separate issue here. The first is...

Could not load signature of Microsoft.CodeAnalysis.SymbolSearch.SymbolSearchUpdateEngine+RemoteControlService:CreateClient due to: Could not load file or assembly 'Microsoft.V
isualStudio.RemoteControl, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.VisualStudio.RemoteControl, Versi
on=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>
Could not load signature of Microsoft.CodeAnalysis.SymbolSearch.IRemoteControlService:CreateClient due to: Could not load file or assembly 'Microsoft.VisualStudio.RemoteContro
l, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.VisualStudio.RemoteControl, Version=14.0.0.0, Culture=neu
tral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>

Adding the .dll fixes this issue.

The second is...

[17-05-28 12:35:53.698]Warning:No metadata is generated for .

This is fixed by editing docfx.json and adding **/*.cs to the source files.

{
  "metadata": [
    {
      "src": [
        {
          "files": [ "**/*.sln", "**/*.cs" ],  <-- FIX
          "exclude": [ "**/bin/**", "**/obj/**" ],
          "cwd": "src"
        }
      ],
...

I made PR #1734 to get a more useful error message for the second issue. The second issue seems to be caused by the lack of support for the new csproj file format.

dlech added a commit to dlech/docfx that referenced this issue Jun 7, 2017
MSBuildWorkspace.OpenSolutionAsync() and MSBuildWorkspace.OpenProjectAsync() do not give any notification that loading a solution or project failed. However, there is a WorkspaceFailed event that we can use to be notified when there is a problem. This logs the diagnotic information from this event to help the user troubleshoot.

Related:
* dotnet/roslyn#19978 (comment)
* dotnet#1686
* dotnet#1708 (comment)
vicancy pushed a commit that referenced this issue Jun 8, 2017
MSBuildWorkspace.OpenSolutionAsync() and MSBuildWorkspace.OpenProjectAsync() do not give any notification that loading a solution or project failed. However, there is a WorkspaceFailed event that we can use to be notified when there is a problem. This logs the diagnotic information from this event to help the user troubleshoot.

Related:
* dotnet/roslyn#19978 (comment)
* #1686
* #1708 (comment)
@vicancy
Copy link
Contributor

vicancy commented Jun 8, 2017

The error is fixed in v2.18.3

@vicancy vicancy closed this as completed Jun 8, 2017
@dlech
Copy link
Contributor Author

dlech commented Jun 8, 2017

Confirmed both issues are fixed under Mono. Thanks!

vicancy pushed a commit that referenced this issue Jun 15, 2017
MSBuildWorkspace.OpenSolutionAsync() and MSBuildWorkspace.OpenProjectAsync() do not give any notification that loading a solution or project failed. However, there is a WorkspaceFailed event that we can use to be notified when there is a problem. This logs the diagnotic information from this event to help the user troubleshoot.

Related:
* dotnet/roslyn#19978 (comment)
* #1686
* #1708 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix dotnet Generate .NET API reference docs fundamental: xplat Cross-platform support
Projects
None yet
Development

No branches or pull requests

2 participants