abp icon indicating copy to clipboard operation
abp copied to clipboard

Docs module exception

Open GeertVeenstra opened this issue 7 years ago • 11 comments

I followed the document https://abp.io/documents/abp/latest/Modules/Docs, but when trying with local FileSystem I am getting an exception:

NullReferenceException: Object reference not set to an instance of an object. AspNetCore._Pages_Documents_Project_Index.ExecuteAsync() in Index.cshtml Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable statusCode) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultAsync(IActionResult result) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResultFilterAsync<TFilter, TFilterAsync>() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultFilters() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.Invoke(HttpContext httpContext) in AbpAuditingMiddleware.cs Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext) Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Any idea where to look to fix it ?

GeertVeenstra avatar Jan 30 '19 06:01 GeertVeenstra

Have you inserted any record to DocsProjects project ?

ismcagdas avatar Jan 30 '19 06:01 ismcagdas

Yes, the SQL statement as described in the document.

INSERT [dbo].[DocsProjects] ([Id], [Name], [ShortName], [Format], [DefaultDocumentName], [NavigationDocumentName], [MinimumVersion], [DocumentStoreType], [ExtraProperties], [MainWebsiteUrl], [LatestVersionBranchName]) VALUES (N'12f21123-e08e-4f15-bedb-ae0b2d939659', N'ABP framework (FileSystem)', N'abp', N'md', N'Index', N'docs-nav.json', NULL, N'FileSystem', N'{"Path":"C:\Github\abp\docs\en"}', N'/', NULL)

And I copied the contents of the default abp/docs/en folder to the C:\Github\abp\docs\en directory.

GeertVeenstra avatar Jan 30 '19 06:01 GeertVeenstra

I added now also the GitHub DocumentStoreType to the DocsProjects table and now when I access the documentation tab I get to choose from the two projects. And they are both working now ? Strang thing however is that I can also choose version when I select the FileSystem project, i thought this was only working for GitHub. Or is the docs module not working yet with the FileSystem storetype and it is always using Github ?

GeertVeenstra avatar Jan 30 '19 07:01 GeertVeenstra

Another question: If I fork the abp repository to my own github account and change the Url in the DocProjects table to reflect to the new Url I get a DocumentNotFoundException.

https://github.com/geertveenstra/abp/tree/{version}/docs/en/

When I change it back to

https://github.com/abpframework/abp/tree/{version}/docs/en/

it is working again ?

I am using the same GitHubAccessToken for both urls.

I was under the assumption that I should be able to use my own repository with this module ?

GeertVeenstra avatar Jan 30 '19 10:01 GeertVeenstra

Any comments ? I am still unable to use this with my own documents location.

GeertVeenstra avatar Feb 03 '19 07:02 GeertVeenstra

I added now also the GitHub DocumentStoreType to the DocsProjects table and now when I access the documentation tab I get to choose from the two projects. And they are both working now ? Strang thing however is that I can also choose version when I select the FileSystem project, i thought this was only working for GitHub. Or is the docs module not working yet with the FileSystem storetype and it is always using Github ?

It may be because of caching.

https://github.com/abpframework/abp/blob/a92686bc997dee46ba24cbdf340e831e146065d9/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs#L66

yekalkan avatar Feb 04 '19 13:02 yekalkan

If I fork the abp repository to my own github account and change the Url in the DocProjects table to reflect to the new Url I get a DocumentNotFoundException.

Bug confirmed. I've just created a new issue.

https://github.com/abpframework/abp/issues/778

yekalkan avatar Feb 04 '19 13:02 yekalkan

@GeertVeenstra I think every problem you're talking about should end now, can you test them?

yekalkan avatar Feb 04 '19 14:02 yekalkan

@yekalkan Thanks, I have tried to compile the docs solution now several times but I keep getting around 75 errors in Visual Studio about missing references... I disabled the automatic Nuget download as suggested in the modules documentation. What are the steps after I download the current source as ZIP file ?

GeertVeenstra avatar Feb 04 '19 19:02 GeertVeenstra

Have you run dotnet-restore command?

yekalkan avatar Feb 04 '19 21:02 yekalkan

OK, I feel stupid now, it seems I need to run the main build-all.ps1 as well. It is compiling now and working as expected.

Thank you very much for your help !

GeertVeenstra avatar Feb 04 '19 22:02 GeertVeenstra