Doraku / DefaultDocumentation

Create a simple markdown documentation from the Visual Studio xml one.
MIT No Attribution
157 stars 26 forks source link

Possible Regression in 0.7.7 #80

Closed hairlesshobo closed 2 years ago

hairlesshobo commented 2 years ago

I am testing out DefaultDocumentation for a few of the projects I am working on, and I have found that I get the following error message when I attempt to build using the MSBuild method..

/home/user/.nuget/packages/defaultdocumentation/0.7.7/build/DefaultDocumentation.targets(38,5): error MSB4018: The "DefaultDocumentationTask" task failed unexpectedly. [/home/user/code/libsmb2sharp/LibSMB2Sharp/LibSMB2Sharp.csproj]
/home/user/.nuget/packages/defaultdocumentation/0.7.7/build/DefaultDocumentation.targets(38,5): error MSB4018: System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'DefaultDocumenation:/home/user/code/libsmb2sharp/LibSMB2Sharp/docs' [/home/user/code/libsmb2sharp/LibSMB2Sharp/LibSMB2Sharp.csproj]
/home/user/.nuget/packages/defaultdocumentation/0.7.7/build/DefaultDocumentation.targets(38,5): error MSB4018:    at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew) [/home/user/code/libsmb2sharp/LibSMB2Sharp/LibSMB2Sharp.csproj]
/home/user/.nuget/packages/defaultdocumentation/0.7.7/build/DefaultDocumentation.targets(38,5): error MSB4018:    at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name) [/home/user/code/libsmb2sharp/LibSMB2Sharp/LibSMB2Sharp.csproj]
/home/user/.nuget/packages/defaultdocumentation/0.7.7/build/DefaultDocumentation.targets(38,5): error MSB4018:    at DefaultDocumentation.Generator.Execute(Settings settings) in D:\a\DefaultDocumentation\DefaultDocumentation\source\DefaultDocumentation.Common\Generator.cs:line 10 [/home/user/code/libsmb2sharp/LibSMB2Sharp/LibSMB2Sharp.csproj]
/home/user/.nuget/packages/defaultdocumentation/0.7.7/build/DefaultDocumentation.targets(38,5): error MSB4018:    at DefaultDocumentation.DefaultDocumentationTask.Execute() in D:\a\DefaultDocumentation\DefaultDocumentation\source\DefaultDocumentation\DefaultDocumentationTask.cs:line 48 [/home/user/code/libsmb2sharp/LibSMB2Sharp/LibSMB2Sharp.csproj]
/home/user/.nuget/packages/defaultdocumentation/0.7.7/build/DefaultDocumentation.targets(38,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/user/code/libsmb2sharp/LibSMB2Sharp/LibSMB2Sharp.csproj]
/home/user/.nuget/packages/defaultdocumentation/0.7.7/build/DefaultDocumentation.targets(38,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/user/code/libsmb2sharp/LibSMB2Sharp/LibSMB2Sharp.csproj]

When attempting to use the dotnet tool, I get the following errors:

2021-09-22 18:05:54.6240|INFO|DefaultDocumentation|Starting DefaultDocumentation with those settings
2021-09-22 18:05:54.6348|INFO|DefaultDocumentation|AssemblyFile: /home/user/code/libsmb2sharp/LibSMB2Sharp/bin/Debug/netstandard2.0/LibSMB2Sharp.dll
2021-09-22 18:05:54.6348|INFO|DefaultDocumentation|DocumentationFile: /home/user/code/libsmb2sharp/LibSMB2Sharp/bin/Debug/netstandard2.0/LibSMB2Sharp.xml
2021-09-22 18:05:54.6348|INFO|DefaultDocumentation|ProjectDirectory: 
2021-09-22 18:05:54.6348|INFO|DefaultDocumentation|OutputDirectory: /home/user/code/libsmb2sharp/docs/api
2021-09-22 18:05:54.6348|INFO|DefaultDocumentation|AssemblyPageName: 
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|InvalidCharReplacement: _
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|FileNameMode: Name
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|RemoveFileExtensionFromLinks: False
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|NestedTypeVisibilities: Namespace
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|GeneratedPages: Namespaces, Types, Members
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|GeneratedAccessModifiers: Public, Private, Protected, Internal, ProtectedInternal, PrivateProtected
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|IgnoreLineBreak: False
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|LinksOutputFile: 
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|LinksBaseUrl: 
2021-09-22 18:05:54.6381|INFO|DefaultDocumentation|ExternLinksFiles:
Unhandled exception. System.IO.IOException: The filename, directory name, or volume label syntax is incorrect. : 'DefaultDocumenation:/home/user/code/libsmb2sharp/docs/api'
   at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at DefaultDocumentation.Generator.Execute(Settings settings) in D:\a\DefaultDocumentation\DefaultDocumentation\source\DefaultDocumentation.Common\Generator.cs:line 10
   at DefaultDocumentation.Program.<>c.<Main>b__0_2(SettingsArgs a) in D:\a\DefaultDocumentation\DefaultDocumentation\source\DefaultDocumentation.Console\Program.cs:line 33
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at DefaultDocumentation.Program.Main(String[] args) in D:\a\DefaultDocumentation\DefaultDocumentation\source\DefaultDocumentation.Console\Program.cs:line 24
Aborted (core dumped)

I reverted back to 0.7.6 and the documentation seems to generate just fine.

Not sure what all information you may need, so here goes:

Operating System: Linux Mint 20.2 (based on Ubuntu 20.04) dotnet environment:

.NET SDK (reflecting any global.json):
 Version:   5.0.202
 Commit:    db7cc87d51

Runtime Environment:
 OS Name:     linuxmint
 OS Version:  20.2
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /snap/dotnet-sdk/120/sdk/5.0.202/

Host (useful for support):
  Version: 5.0.5
  Commit:  2f740adc14

.NET SDKs installed:
  5.0.202 [/snap/dotnet-sdk/120/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.5 [/snap/dotnet-sdk/120/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.5 [/snap/dotnet-sdk/120/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

My .csproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <PackageId>FoxHollow.LibSMB2Sharp</PackageId>

    <TargetFramework>netstandard2.0</TargetFramework>

    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <DefaultDocumentationLogLevel>Debug</DefaultDocumentationLogLevel>
    <DefaultDocumentationFolder>docs</DefaultDocumentationFolder>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="DefaultDocumentation" Version="0.7.7">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
  </ItemGroup>

</Project>

Please let me know if you need any further information or assistance hunting down this issue.

Doraku commented 2 years ago

uhhh it seems the creation of the mutex fails on linux (it is used to ensure only one documentation is generated at a time to the output when you use multiple TargetFrameworks). I will check what are the expected names for a mutex on linux >_> sorry for missing this.

hairlesshobo commented 2 years ago

No problem! I was looking at the code last night and I noticed that you do a .Replace('\\', '|') when creating the mutex.. I have a hunch that you may just need to do an additional .Replace('/', '|') to account for the forward slash that linux uses in paths. If I get a chance today, I'll try making that change and see if it solves the issue.

Doraku commented 2 years ago

yes I got to the same conclusion :)