-
Im creating a modular application. When I reference the module without using Microsoft.AspNetCore.Identity.UI I can see the resources that the referenced module uses. But when I add Microsoft.AspNetCore.Identity.UI then I get 500 errors for all the resources that are referenced by the module. When I go inspect the element that is not being served I get: An unhandled exception occurred while processing the request. Any help would be greatly appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
The razor class library with area is not supported with orchard core modular framework #4247 #10230 #10287 |
Beta Was this translation helpful? Give feedback.
-
Thank you Niraj! Do you know if there a way to add identity to my module without the cms?
On Feb 17, 2024, at 8:13 AM, Niraj Soni ***@***.***> wrote:
The razor class library with area is not supported with orchard core modular framework
—
Reply to this email directly, view it on GitHub<#15351 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABEPCDBHZYVJBD5ARFBSDELYUCUINAVCNFSM6AAAAABDMSDRZWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKMBQG42DK>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have not tried but you could implement |
Beta Was this translation helpful? Give feedback.
-
@upaelfid This is how I made it to work.
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.2" />
<PackageReference Include="OrchardCore.Application.Mvc.Targets" Version="1.8.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Identity\Identity.csproj" />
<ProjectReference Include="..\Module1\Module1.csproj" />
</ItemGroup>
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
builder.Services
.AddOrchardCore()
.AddMvc()
// Orchard Specific Pipeline
.ConfigureServices(services =>
{
// Add services to the container.
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(connectionString));
services.AddDatabaseDeveloperPageExceptionFilter();
services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<ApplicationDbContext>();
})
.Configure((app, routes, services) =>
{
app.UseAuthorization();
})
;
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseOrchardCore();
app.Run(); |
Beta Was this translation helpful? Give feedback.
I used OC
Identity
module which as nothing in it. It allows OC to be aware ofIdentity
module with areaIdentity
.Identity
area is already exists in Identity UI, so OC will serve UI from Identity UI.All Identity related Data are in main WebApp