0
votes

A few months a go I created a Razor Class Library using the Visual Studio Template, and I got an MVC type library with Pages, _ViewStart, and etc... But after I updated to Visual Studio 16.3.2 with Asp.net Core 3.0, I added a "Razor Class Library" and what I got was a "Razor Components Library" instead.

I am seeing Microsoft use "RCL" in two different ways in Documentation.

How do I create a "Razor Class Library" which has the Pages,_viewstarts files in it vs the component library which is for blazor?

Addition:

https://docs.microsoft.com/en-us/aspnet/core/razor-pages/ui-class?view=aspnetcore-3.0&tabs=visual-studio

https://docs.microsoft.com/en-us/aspnet/core/blazor/class-libraries?view=aspnetcore-3.0&tabs=visual-studio

If you look at the links above, one is for Razor UI Class Library and one is for Razor Component Library. Before the .NET core 3.0 release and Visual Studio 16.3.2 the Razor UI Class Library walkthrough worked, it no longer works. The same steps create a Razor Component Library.

The question is what happened to the Razor UI Class Library provided in the documentation? It seems like there should be two templates with better defined names.

Addition 2:

https://github.com/aspnet/AspNetCore/issues/7536

It appears the old RCL template in VS has been swapped out with the component library. So, the issue looks by design, but the question is still where is a page/views VS template to setup that type of "RCL"?

Addition 3:

The Razor Class Library for Page/Views has been moved, but it's not in the VS UI, it appears the issue is being worked on. In the meantime, I took an RCL (page/views) project and put it into another project as a work around, and this worked for me.

"The Razor class library (RCL) template defaults to Razor component development by default. A template option in Visual Studio provides template support for pages and views."

1
Razor and Blazor are different, do read up on it to understand: google.com/amp/s/espressocoder.com/2019/02/21/…Jeremy Thompson
I understand the difference. You did not read my post in detail. There is nothing in your blog post that discusses RCL being the mvc type library or the component library. Try to create a .NET core razor solution and add a Razor Class Library project for VS 16.3.2, and you will not get a Razor Class Library but a Razor Component Library and these are different things.CPGAdmin

1 Answers

-1
votes

The Razor Class Library for Page/Views has been moved, but it's not in the VS UI, it appears the issue is being worked on. In the meantime, I took an RCL (page/views) project and put it into another project as a work around, and this worked for me.

The walkthrough for an RCL with Page\views reads:

"The Razor class library (RCL) template defaults to Razor component development by default. A template option in Visual Studio provides template support for pages and views."

But when going through the walkthrough, the UI option isn't there, and I found discussions about this with the owners.