Doraku / DefaultDocumentation

Create a simple markdown documentation from the Visual Studio xml one.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin configuration

HClausing opened this issue · comments

Hello,

I'm getting some problems on trying to configure a plugin to use subfolder structure.

I've tried to follow the steps on Sample , but DefaultDocumentationFileNameFactory or --FileNameFactory appears to be not working here.

Steps:

1) Created my Plugin project targeted to NetStandart 2.0;

2) Added a DefaultDocumentation.API package reference;

image

3) Added a FolderFileNameFactory.cs class, exactly as sample;

image

4) Setup a .csproj file to be like the sample (just added some package properties):

image

5) Testing with package:

Tried first to add a package reference to my project, and figured that the .csproj file didn't created the line specified on target.

6) testing as Project Reference

6.1) I've added my plugin as project reference to my target project;

6.2) Added <DefaultDocumentationFileNameFactory>Folder</DefaultDocumentationFileNameFactory> tag to target csproj file;

6.3) Removed <DefaultDocumentationFileNameFactory>Name</DefaultDocumentationFileNameFactory> tag.

6.4) Added
<DefaultDocumentationPlugins>$(DefaultDocumentationPlugins)|$(MSBuildThisFileDirectory)../../Plugins/EficazFramework.DocsApiPlugin/bin/$(Configuration)/lib/netstandard2.0/EficazFramework.DocsApiPlugin.dll</DefaultDocumentationPlugins>
on csproj file, next to <DefaultDocumentationFileNameFactory>.

6.5) Target .csproj file:
<GenerateDocumentationFile>true</GenerateDocumentationFile> <DefaultDocumentationFolder>..\..\..\Docs\Api\Data</DefaultDocumentationFolder> <DefaultDocumentationAssemblyPageName>EficazFramework Data</DefaultDocumentationAssemblyPageName> <DefaultDocumentationGeneratedPages>Assembly, Types, Members</DefaultDocumentationGeneratedPages> <DefaultDocumentationFileNameFactory>Folder</DefaultDocumentationFileNameFactory> <DefaultDocumentationPlugins>$(DefaultDocumentationPlugins)|$(MSBuildThisFileDirectory)../../Plugins/EficazFramework.DocsApiPlugin/bin/$(Configuration)/lib/netstandard2.0/EficazFramework.DocsApiPlugin.dll</DefaultDocumentationPlugins>

7) The error:

Gravidade Código Descrição Projeto Arquivo Linha Estado de Supressão Erro MSB4018 Falha inesperada da tarefa "DefaultDocumentationTask". System.Exception: Error while writing documentation for EficazFramework.ViewModels.Services.ServiceUtils.AddSingledEditDetail&lt;T,D&gt;(EficazFramework.ViewModels.ViewModel&lt;T&gt;, System.Linq.Expressions.Expression&lt;System.Func&lt;T,System.Collections.Generic.IList&lt;D&gt;&gt;&gt;) ---> System.IO.DirectoryNotFoundException: Não foi possível localizar uma parte do caminho 'E:\Henrique Clausing\Repositorios\Current\EficazFramework\Docs\Api\Data\EficazFramework_ViewModels_Services_ServiceUtils_AddSingledEditDetail_T_D_(EficazFramework_ViewModels_ViewModel_T__System_Linq_Expressions_Expression_System_Func_T_System_Collections_Generic_IList_D___).md'. em System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) em System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) em System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) em System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) em System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) em System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost) em DefaultDocumentation.Writer.DocItemWriter.Execute() na D:\a\DefaultDocumentation\DefaultDocumentation\source\DefaultDocumentation.Common\Writer\DocItemWriter.cs:linha 112 --- Fim do rastreamento de pilha de exceções internas --- em DefaultDocumentation.Writer.DocItemWriter.Execute() na D:\a\DefaultDocumentation\DefaultDocumentation\source\DefaultDocumentation.Common\Writer\DocItemWriter.cs:linha 116 em DefaultDocumentation.Generator.Execute(Settings settings) na D:\a\DefaultDocumentation\DefaultDocumentation\source\DefaultDocumentation.Common\Generator.cs:linha 19 em DefaultDocumentation.DefaultDocumentationTask.Execute() na D:\a\DefaultDocumentation\DefaultDocumentation\source\DefaultDocumentation\DefaultDocumentationTask.cs:linha 70 em Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() em Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() EficazFramework.Data C:\Users\hclau\.nuget\packages\defaultdocumentation\0.7.9\build\DefaultDocumentation.targets 38

Can you give a help please?

Thanks.

In my opinion a did something wrong on and DefaultDocumentation aren't reading my plugin. But I can't figure what I did wrong.

It seems it is still using the version 0.7.9 to generate the documentation (which don't use plugins) as the last line of your logs state:

C:\Users\hclau.nuget\packages\defaultdocumentation\0.7.9\build\DefaultDocumentation.targets

so it doesn't use <DefaultDocumentationFileNameFactory> but looks for <DefaultDocumentationFileNameMode> which is not there and use the default FullName which produces this too long path.
did you change the DefaultDocumentation package reference to 0.8.0-alpha2 in your library too?

Oh , I missed to check the "Include Prereleases" on Nuget Package Manager and didn't figured this version.

I'm really sorry for this mistake, and thank you again!

Here are the (amazing!) results:
image

No worries, great to know you managed to do what you wanted :)