Is there a way to call Orchard.DisplayAsync
from a page in the Pages/ folder? I have a page that looks something like this:
@page "/{item}/form"
@inject OrchardCore.IOrchardHelper Orchard
@{
var itemPath = ViewContext.RouteData.Values["item"];
var contentItem = await Orchard.GetContentItemByHandleAsync("slug:" + itemPath, true);
}
<div>
Have some content:
@await Orchard.DisplayAsync(contentItem);
</div>
And it can't seem to find DisplayAsync on Orchard? 'IOrchardHelper' does not contain a definition for 'DisplayAsync' and the best extension method overload 'OrchardRazorHelperExtensions.DisplayAsync(IOrchardDisplayHelper, ContentItem, string, string, IUpdateModel)' requires a receiver of type 'IOrchardDisplayHelper'
. Is there a way to inject an instance of IOrchardDisplayHelper instead of IOrchardHelper?
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An unhandled exception has occurred while executing the request. System.Exception: Shape type 'CustomEmailTask_Fields_Design' not found
. And then there is probably like 500 or more lines of stack trace data. Again, the workflows work great locally. I am only running in to this problem on my dev/prod server.
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An unhandled exception has occurred while executing the request. System.Exception: Shape type 'CustomEmailTask_Fields_Design' not found
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An exception was thrown attempting to execute the error handler. System.InvalidOperationException: Multiple handlers matched. The following handlers matched route data and had all constraints satisfied: Void OnGet(), Void OnGet()
2021-10-22 15:46:07.9675|Default|00-e58340824438a948a758976c2522db95-31eb2ee35aa67849-00||Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware|ERROR|An unhandled exception has occurred while executing the request. Microsoft.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PKDocument3214EC071B675274'. Cannot insert duplicate key in object 'dbo.Document'. The duplicate key value is (21).
Any ideas?
Almost there now with http://new.nogginbox.co.uk/
But my menu tag is getting rendered in the HTML as:
<menu alias="alias:main-menu" cache-id="main-menu" cache-fixed-duration="00:05:00" cache-tag="alias:main-menu" />
[Route("")]
or [Route("~/")]
works
IBackgroundTask
needs to be enabled from the Admin module. The problem is I don't have this. Is there anyway for me to enable a background task from code?
Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer: Connection ID "14195346027082417527", Request ID "80000578-0000-c500-b63f-84710c7967bb": An unhandled exception was thrown by the application.System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Http.Polly, Version=5.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
<h3>HTTP Error 500.0 - Internal Server Error</h3>
<h4>The page cannot be displayed because an internal server error has occurred.</h4>
</div> <fieldset>
<h4>Most likely causes:</h4>
<ul>
<li>IIS received the request; however, an internal error occurred during the processing of the request.
The root cause of this error depends on which module handles the request and what was happening in
the worker process when this error occurred.</li>
<li>IIS was not able to access the web.config file for the Web site or application. This can occur if
the NTFS permissions are set incorrectly.</li>
<li>IIS was not able to process configuration for the Web site or application.</li>
<li>The authenticated user does not have permission to use this DLL.</li>
<li>The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.</li>
</ul>
</fieldset>
</div> <fieldset>
<h4>Things you can try:</h4>
<ul>
<li>Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web
server's machine account.</li>
<li>Check the event logs to see if any additional information was logged.</li>
<li>Verify the permissions for the DLL.</li>
<li>Install the .NET Extensibility feature if the request is mapped to a managed handler.</li>
<li>Create a tracing rule to track failed requests for this HTTP status code. For more information about
creating a tracing rule for failed requests, click <a
href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li>
</ul>
</fieldset>
</div>```https://github.com/OrchardCMS/OrchardCore/issues/3656#issuecomment-953845319
Can anyone advise on this?