Код: Выделить всё
Код: Выделить всё
var assembly = callingAssembly;
builder.Services.AddControllers().AddApplicationPart(typeof(WebAppHostProgram).Assembly);
builder.Services.AddRazorPages().AddApplicationPart(assembly).AddRazorRuntimeCompilation(
options =>
{
// important to clear because some of them are null
options.FileProviders.Clear();
// resolve views as embedded resources
options.FileProviders.Add(new EmbeddedFileProvider(typeof(HomeController).Assembly));
});
Код: Выделить всё
[DOTNET] info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[105]
[DOTNET] Executed action MauiApp.Web.Controllers.HomeController.Index (MauiApp.Web) in 2156.7141ms
[0:] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Information: Executed action MauiApp.Web.Controllers.HomeController.Index (MauiApp.Web) in 2156.7141ms
[DOTNET] info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
[DOTNET] Executed endpoint 'MauiApp.Web.Controllers.HomeController.Index (MauiApp.Web)'
[0:] Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executed endpoint 'MauiApp.Web.Controllers.HomeController.Index (MauiApp.Web)'
[DOTNET] fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
[DOTNET] An unhandled exception has occurred while executing the request.
[DOTNET] Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.CompilationFailedException: One or more compilation failures occurred:
[DOTNET] lhzz1lae.ayr(4,20): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
[DOTNET] lhzz1lae.ayr(4,82): error CS0518: Predefined type 'System.Type' is not defined or imported
[DOTNET] lhzz1lae.ayr(4,120): error CS0518: Predefined type 'System.String' is not defined or imported
Подробнее здесь: https://stackoverflow.com/questions/786 ... on-compila