Web administration panel as a separate assembly

Now I am working on an MVC-based web analytics system. During development, I got a good idea about removing the admin panel to split the assembly. This is for use in my other projects. Thus, in the future I could just reference this assembly and not care about the web layout panel.

The web dashboard itself is markup elements with a limited design. It contains the main menu, a submenu and a place for filling the necessary other elements.

at the moment I have an assembly with all the views on such a panel using RazorGenerator.

The problem is, how can I manage css files for such an assembly? Should I just embed them in the views and place these views to compile the assembly or deploy them as separate assembly css files?

These css packages will be compressed / minimized or somehow integrated into the final project.

+4
source share
2 answers

You can pack the css and js files as resources and use them with a resource handler, but you will not be able to edit them in future projects if a design exception occurs (for example, you need to change the css class because it encounters the main css of another project )

Why not create a nuget package? some advantages

  • You have everything in the zip file (you do not need to publish the package to use it)
  • You can add a project directly from the console
  • nuget creates an appropriate folder structure for views and controllers for the administration area.
  • If you need to delete it, you just delete it, and it selected all the files.
  • In addition, you have the ability to modify the css and js files for the administrator.
  • This is easier than having a black box DLL in your application that processes routes and maintains packed files that are hidden from the rest of the application.

Here are some guides for creating your own nuget package:

+3
source

Is this a deployable build? For example, will it be added to many different systems in different places or will it be used, for example, on a corporate network?

If you are deploying the assembly, you probably want to compile css as resources and use the built-in ASP.Net resource handler to serve css. Thus, you have no dependencies on anything else, you pre-compress / reduce css, and the host server can take care of caching.

If this is for the corporate network or the servers you manage, then put css on the central server and provide all the links to this location. However, the previous approach also works here.

+1
source

Source: https://habr.com/ru/post/1486606/


All Articles