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

[mdoc] Error when updating on a .NET Core assembly #5

Closed
joelmartinez opened this issue Dec 8, 2016 · 2 comments
Closed

[mdoc] Error when updating on a .NET Core assembly #5

joelmartinez opened this issue Dec 8, 2016 · 2 comments
Labels
Milestone

Comments

@joelmartinez
Copy link
Member

In the currently released version of mdoc, you receive the following error when you try to mdoc update a .NET Core assembly:

$ mdoc update --debug bin/Debug/netcoreapp1.0/dnnew.dll -o en -L /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0-rc2-3002702/
mdoc: System.NotSupportedException: Specified method is not supported.
  at Mono.Cecil.PE.ImageReader.ReadArchitecture () [0x00040] in <6f5dcfb43b83409e9bb6016a08899100>:0 
  at Mono.Cecil.PE.ImageReader.ReadImage () [0x0005c] in <6f5dcfb43b83409e9bb6016a08899100>:0 
  at Mono.Cecil.PE.ImageReader.ReadImage (Mono.Disposable`1[T] stream, System.String file_name) [0x00008] in <6f5dcfb43b83409e9bb6016a08899100>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (Mono.Disposable`1[T] stream, System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00006] in <6f5dcfb43b83409e9bb6016a08899100>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0006f] in <6f5dcfb43b83409e9bb6016a08899100>:0 

It looks like we should be able to work around this with a newer version of Mono.Cecil (or will be soon as they are obviously still adding some facilities like a default AssemblyResolver for .net core).

@joelmartinez joelmartinez added this to the v5.0 Preview milestone Feb 13, 2017
joelmartinez added a commit that referenced this issue Feb 15, 2017
In some cases, for example when running in "frameworks" mode (ie. #18), you might have non-managed .dlls in the directory. This change allows mdoc to simply write the fact that it couldn't load the assembly, and continue doing work.
Resolves #7
Provices a temporary workaround for #8, #9, and #5
@joelmartinez
Copy link
Member Author

joelmartinez commented Feb 16, 2017

We are now on a much newer Mono.Cecil (ad2c3d9), and still encountering this same issue. Investigating the solution to this ... filed a GH Issue on Mono.Cecil: jbevain/cecil#329

@joelmartinez
Copy link
Member Author

This issue was inadvertently resolved when I merged PR#18 ... which brought in jbevain/cecil@bb40c21

So .NET core assemblies can now be documented, as long as you include a reference to the lookup directory (platform dependent, obviously). If you're documenting a single assembly, you can use -L:

mdoc update -o some/corelib.dll -L /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/

Or under frameworks mode:

<?xml version="1.0" encoding="utf-8"?>
<Frameworks>
  <Framework Name="Some .NET Core Framework" Source="path/to/acorelib">
    <assemblySearchPath>/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/</assemblySearchPath>
  </Framework>
</Frameworks>

/cc @dend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant