red-gate / XmlDoc2CmdletDoc

Create cmdlet XML help files from XML doc comments
Other
63 stars 24 forks source link

Problem using the NuGet package in .NET Core 3.1 project #55

Open Ergamon opened 4 years ago

Ergamon commented 4 years ago

I am trying to use this NuGet package in a .NET Core 3.1 project.

When I build I get an error in the build output of VS telling something about missing rights, which is completly wrong. When I try to run the shown command I get a more reasonable long error message, basically telling me that the commandline tool cannot find the assembly System.Runtime in version 4.2.2.0.

Does anyone know a workaround for this?

ChrisLambrou commented 4 years ago

This package currently only supports .NET Framework 4.5 onwards. I've recently been working on support for .NET Standard 2.0, .NET Core 2.1 and .NET Core 3.1, and have just published a pre-release package for this, ready for internal testing at Redgate.

See https://www.nuget.org/packages/XmlDoc2CmdletDoc/0.4.0-dotnetcore0000

If you're still interested, I'd appreciate it if you'd give it a try and let us know how it goes.

Ergamon commented 4 years ago

Sorry for the late reply.

I found some time to experiment with this version and it looks promising.

Meanwhile there is a newer pre release version (0.4.0-dotnetcore0001) online. But this one I couldn´t get working. Once I downgraded to the version you mentioned everything worked again.

SteveGilham commented 4 years ago

Having just noticed the 0.4.0 pre-release, I observe that in this context 1) the netcoreapp3.1 version launches quite happily on a machine with only a 3.1.x runtime 2) the netcoreapp3.1 version is redundant, and could be replaced by adding a XmlDoc2CmdletDoc/XmlDoc2CmdletDoc/runtimeconfig.template.json containing

{
  // Rollforward across major versions of ASP.NET Core
  // The default setting only will only rollforward across minor versions
  "rollForwardOnNoCandidateFx": 2
}

or the equivalent --roll-forward Major to the command line generated by the targets file, like

<XmlDoc2CmdletDocCommand Condition="$(XmlDoc2CmdletDocToolPath.EndsWith('.dll'))">dotnet --roll-forward Major "$(XmlDoc2CmdletDocToolPath)"</XmlDoc2CmdletDocCommand>

3) The Jolt doc-comment reading library is, alas, bound to the .net framework on Windows via Jolt.XmlDocCommentReaderSettings (at least), so while the tool starts happily on a Linux VM with Mono 6.10 and .net SDK 3.1.x, the process fails with

System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.IO.Path.Combine(String path1, String path2)
   at Jolt.XmlDocCommentReaderSettings.CreateDefaultSettings()
   at Jolt.XmlDocCommentReaderSettings..cctor()

when it discovers that Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); is null. There's some other dubious code in that method (like adding a literal " (x86)" to get a 32-bit program files path)

FLAMESpl commented 3 years ago

0.4.0 prerelease does not work for my app in net5, same permission error. Looking forward to new updates.

trondr commented 2 years ago

0.4.0 prerelease does not work for my app in net5, same permission error. Looking forward to new updates.

I have similar issue with .net5. Just created a pull request for adding .net 5 support. https://github.com/red-gate/XmlDoc2CmdletDoc/pull/61

With XmlDoc2CmdletDoc support for .net 5.0 it is possible to create maml from a .net 5.0 F# binary project (after manually adding the FSharp.Core.dll to the same folder as XmlDoc2CmdletDoc.exe).