97 questions
0
votes
1
answer
53
views
Sharing and auto inclusion of razor class library static assets via MSBuild <AutoImportReference> tag
I've used GitHub copilot to create an app to test auto inclusion of static assets through intermediary RCL.
I have a BlazorWasm project references a RCL project. RCL-A is for components and some ...
0
votes
0
answers
49
views
MudBlazor Styling Not Applied in Razor Class Library When Used in Host Application
I'm using MudBlazor in a Razor Class Library (RCL) and facing an issue with styles not being applied correctly when the RCL is used in another application.
Setup:
I have a Razor Class Library (RCL) ...
0
votes
2
answers
402
views
Static content and CSS isolation bundles from dynamically added Razor Class Library not working
Using .NET 9 and a Blazor web app (with server interactive rendering mode), I'm struggling to get static assets (or CSS isolation bundles) from a Razor class library to work with my Blazor web app.
I ...
0
votes
0
answers
24
views
Razor Class Library Authorization inside WASM and Server
I'm trying to use a Razor Class Library to reuse components between MAUI, WASM, and Server instances. In my RCL project I wish to be able to use the <AuthorizeView><Authorized> built in ...
1
vote
1
answer
499
views
How to enable interactivity for pages/components within a Razor Class Library for a Blazor App with .NET 8?
I am currently working on developing an application in Blazor with .NET 8, and I am designing it to be modular. The main app is a Blazor project with server-side rendering, and I have structured it so ...
0
votes
1
answer
37
views
Razor class library - view from library is not used for controller in host
Host application is ASP.NET Core MVC. Host application has SampleController and Index action. Index action has no View file in host project.
Structure:
- Host application
├── Controllers
│ └── ...
0
votes
2
answers
198
views
Referencing a razor page from a Razor Class Library is giving a 404 error
I am trying to reference a razor page contained in a Razor Class Library in a Blazor project. When I go to the route of my page I am getting a 404 error.
Steps to recreate
Create a new solution as a ...
0
votes
0
answers
140
views
Consuming external client libraries in Blazor Razor Class Library
I'm creating a Razor Class Library (RCL) to use within several solutions. Some of these solutions may use this RCL alongside others within each project.
This RCL will also use some external client ...
2
votes
0
answers
434
views
Blazor Server, Entity Framework Core 8, and DBContextFactory
I'm trying to work on a design for a Blazor Server application for enterprise where I have one project that contains UI, Services, etc for the entire application, and modular pieces different ...
0
votes
0
answers
132
views
Html.Raw for RazorClassLibrary
When using a Razor Class Library project template with "Support pages and views" unchecked, it produces a project that uses *.razor files.
This project does not have a framework reference to ...
2
votes
2
answers
341
views
Prevent Blazor Router to found some components with @page directive
In blazor Server-Side, I have a Razor Class Library with several components that can be routed because they have the @page directive.
This is my code on App.razor:
<CascadingAuthenticationState>
...
2
votes
1
answer
2k
views
Blazor in .NET 8: Routing issue when load Page from Razor Class Library
I am currently encountering a routing issue in my new .NET 8 Blazor project. When attempting to navigate to a page defined in a Razor class library, I encounter a 404 error.
The Razor class library ...
0
votes
1
answer
268
views
Unable to find 'Software1.dll;Software2.dll' to be lazy loaded later. Confirm that project or package references are included and the reference is u
In a webassembly project I created two Razor Class Libraries Software1 and Software2 and added a reference to both in the main client app.
I also added these to my client's Project file:
<ItemGroup&...
0
votes
2
answers
791
views
Moving Razor Pages and Layouts to RCL
I can't seem to get why the Blazor Server Web runs with a 404 when I try to move Components/Pages and Components/Layouts from the default Blazor Server Web project to a new RCL project.
Everything is ...
0
votes
2
answers
193
views
prefix razor pages in razor class library
I was wondering if there is an option to prefix the route of razor pages inside a razor class library?
I want to create a blazor application which includes other modules each module should also have ...
0
votes
1
answer
137
views
How to use app services in imported razor class library components
I have created a rcl razor class library and referenced it in my web assembly app.
The articles on the web discuss how to import static assets used in rcl to the main app.
But if the imported rcl ...
1
vote
0
answers
131
views
Razor class library static web assets on different urls before and after publish when libman used
I use static web assets in razor class library, and they are on different paths on local run under VS and published final docker image.
In JoinRpg.WebComponents RCL there is .\JoinRpg.WebComponents\...
0
votes
1
answer
700
views
How to share (export) a global (non-scoped) css file from razor class library between Blazor server and MAUI hybrid projects
From what I understood and observed, every css scoped file (*.razor.css) is automatically bundled (rewritten when necessary to ensure isolation) and exported in a project bundle {ASSEMBLY NAME}.bundle....
0
votes
1
answer
1k
views
How to share Razor components with the need for interactivity in a Razor Class Library (.Net 8)
I have created a MAUI Blazor App and a Blazor WEB App (.NET 8) and a common Razor Class Library using out of the box projects.
My problem is the how to put the Counter.Razor page into the Razor Class ...
0
votes
1
answer
109
views
Service in Blazor
How to make a service in balzor that can work in every module of the project including in RCL.
For example:
Have a project: ServiceTestBlazorServerApp,
Few RCLs: MainRazorClassLibrary, ...
2
votes
0
answers
474
views
nuget - missing staticwebassets folder after custom pack
I am building a shared library as RCL where my components are located and can be shared in several applications.
This library contains "global" styles as well as "component-bound (...
0
votes
0
answers
151
views
PostAsJasonAsync returns 502 Bad Gateway in Maui Blazor Hybrid app, but not in postman or in Blazor WebAsembly
I have two apps, that share code for posting with httpclient.PostAsJasonAsync in a common Razor library.
One is a Blazor WebAssembly and the other is a Maui Blazor Hybrid app.
In the Blazor Web ...
1
vote
0
answers
298
views
ASP.NET Core MVC web app using RCL (NuGet package)
The base application (MyTestApp) is an ASP.NET Core MVC web app (based on the default template). In addition, a Razor Class Library (RCL) has been created (MyRazorClassLibrary). The css, js and lib ...
0
votes
1
answer
500
views
Razor Class Library for Blazor Hybrid app in .Net8 Fails with No Registered service of type Routing.IScrollToLocationHash at Microsoft.AspNetCore.Co
Out of the boks I'm createing a Blazor Hybrid App with a Razor Class library using .Net 8
Includes a project reference to the RCL
Moving the folders Pages, Shared and Data to the Class Library.
...
1
vote
0
answers
51
views
Newly added cshtml files to RCL (Razor Class Library) are automatically removed in project file
After adding a shared _JstreeSearchInput.cshtml file, I noticed that it coucld not be used by other projects. This was a re-happened problem so after several minutes I re-remembered that these codes ...
1
vote
1
answer
665
views
MAUI-Blazor add AdditionalAssembly programmatically
I am trying to found a good way to arrange my Razor class libraries to let use them in MAUI Blazor hybrid applications
My problem is about the route when the class libraries contains componentes with @...
1
vote
0
answers
478
views
Issue finding razor pages from Razor class library
I have .net core app using razor pages that references a Razor class library (RCL). Everything seems to be working fine. Intelisense is able to find it when I use the @using directive and I can use ...
0
votes
1
answer
502
views
Using reflection how do I list the contents of the wwwroot files in a Razor Class Library (RCL)
I have a Razor Class Library that I reference and I have the following structure.
wwwroot
-- Css
--- styles.css
-- Js
--- scripts.js
I can reference these files in the main project with the ...
0
votes
0
answers
495
views
How to properly include a Razor class library using SignalR into a MAUI Blazor app
My requirement is to reuse a razor component, which uses SignalR from a razor class library inside a Blazor Server app and a MAUI Blazor app. The MAUI app is only supposed to run on Windows.
The ...
0
votes
1
answer
143
views
Can abp suite target a razor class library (RCL) for UI components/pages?
I'm new to abp, and I've managed to follow a few tutorials to get familiar with the basics of the framework, but I can't figure out how to generate a solution with an extra layer between the .HttpApi ...
0
votes
1
answer
238
views
How to use RCL as assembly in Maui project?
It seems that I don't understand how to properly connect rcl to the Maui project. And I can't find approach that will help me.
In the example below I tried to reuse component from the RCL. Firstly css ...
0
votes
1
answer
126
views
Create multiple Razor Class Library (RCL) for the same application and include conditionally only one of them per deployment
I'm working on a web shop application written in ASP MVC Core .NET 6 designed to be deployed multiple times - once per country. All deployments will be similar to itself (all are meant for the same ...
0
votes
1
answer
592
views
Having trouble getting a controller in a Razor Class Library to work, What am I missing?
I am having a terrible time getting a REST API controller that is located in an external assembly (in other words, a Razor Class Library) to work. Whenever I make a call to the API via JavaScript, I ...
1
vote
1
answer
861
views
Hot Reload of .cshtml files within a Razor Class Library (or any solution to avoid Rebuild)
I have a bare bones razor pages project targeting the net6.0 framework using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 6.0.11 (Microsoft.NET.Sdk.Web).
It consumes a Razor Class Library, also ...
0
votes
1
answer
301
views
Razor Class Library - can it contains Classes
I am developing a .Net 6 Blazor Server app and im creating a seperate RazorClassLibrary to store my .razor components. Which is going well. I was wondering can I store classes within a ...
2
votes
2
answers
807
views
Can you access razor class library static content from inside the consuming project at build time?
When importing a Razor Class Library to a blazor app (or mvc I guess) is it possible to get to assets that come from that RCL from within the blazor app. I'm specifically interested in if it possible ...
1
vote
0
answers
229
views
Blazor Modular UI application hosted in service container, routing problem
I'm trying to create a Blazor application where ultimately the host and layout are declared in one Razor Class Library or application and applied across other RCL modules. I've tried a few variants ...
4
votes
0
answers
2k
views
Is there a way to import all blazor components within a root level namespace between razor class libraries?
I have quite a big project with various RCLs and each contains a myriad of components that end up being consumed from the root app.
The problem im finding is as I get more components I need to change ...
3
votes
2
answers
2k
views
Blazor Maui App is Not Displaying Images that are in a Razor Class Library project
The images are referenced in a razor component that's defined in a Razor Class Library in the "wwwroot/Images" folder.
I've included a project reference to this Razor Class Library in my ...
0
votes
1
answer
2k
views
Adding an additional assembly to App.razor router in Blazor causes _Host.cshtml to throw 'Object reference not set to an instance of an object'
I have a Razor Class Library (RCL) that contains both Razor components and pages. This RCL has a folder named "Pages" which contains an Index.razor page and one named Details.razor. I have ...
2
votes
0
answers
379
views
Scoped CSS files are not applying their styles in Razor Class Library Components
A component in a Razor Class Library has it's scoped CSS file, but the classes in there are not being applied. Even the CSS class name my-component found in the out-of-the-box component Component1....
1
vote
1
answer
3k
views
Razor Class Library wwwroot content access
I have a Razor Class Library which contains some razor views, and some content within its wwwroot folder.
When I import the compiled DLL file into a .NET Core web project using Visual Studio (Add ...
0
votes
1
answer
351
views
Persisting data between events in Razor Class Library control
I am trying to create a Razor Class Library (RCL), which I can then use as a reusable set of controls in my Blazor Server app. The RCL control is a table that includes pagination and sorting of ...
1
vote
0
answers
670
views
Maui Blazer save a text file
I'm new to .net Maui, I have a shared RCL, razor class library, project that is being shard between Blazor WASM and Blazor Maui.
Following this blog, in RCL I have a shared code that can save a file
...
0
votes
1
answer
183
views
How to access Custom Element from a JSLibrary that is Wrapped in C# Nuget Package - Blazor .NET
I've wrapped model-viewer JS library in a C# Razor Class Library and made it a Nuget package. However, different from other JS Libraries, Model-Viewer doesn't have many methods, it's main property is ...
0
votes
1
answer
415
views
How to disable Overriding Razor class library views
I am now using ASP.Net Core to write a web application and relative Razor Class Libraries.
I know a view (*.cshtml) defined in a Razor Class Library can be override in web application. It brings ...
3
votes
1
answer
1k
views
RazorViewEngine in console app cannot find View
I have the following
dotnet core 6 console app
dotnet core 6 Razor Class Libary (with .cshtml)
I'm doing a View Engine RenderAsync() that works just fine in web api.
When running in a console app ...
2
votes
0
answers
274
views
How do you properly integrate a framework/boilerplate NuGet package into your web app in ASP.NET Core?
I have written a prototype RCL, which contains the following structure:
Now I want to implement this logic to override the local files in an another web app, using this directory structure above as a ...
2
votes
1
answer
2k
views
How do you import a Razor page from a RCL you got from a NuGet package?
RCL stands for Razor class library.
I made my own prototype RCL with a Shared file _Layout.cshtml and I want to include it in my project. I already installed the RCL from NuGet hoping it would ...
2
votes
1
answer
1k
views
NETSDK1152 Error for _ViewImports.cshtml files
After upgrading my WebApp from NET5 to NET6, when trying to push my WebApp to the Azure AppService, I get the NETSDK1152 error:
Found multiple publish output files with the same relative path:
C:...\...