简体   繁体   中英

Why aren't Umbraco Templates (Views) part of the Solution/Project in Visual Studio?

I typically work on ASP.NET Core MVC projects, but am currently working on an Umbraco site. A difference I noticed, and don't understand, is that the .cshtml files in the Views folder (which are the Umbraco Templates) are only visible in the Folder View of the Solution Explorer. Why aren't they included in the project and visible in the normal Solution Explorer view like they are in a normal MVC project?

Example:

Folder View:

在此处输入图片说明

Normal Solution Explorer View:

在此处输入图片说明

通常是因为没有人添加它们;-)开个玩笑,还可以通过Umbraco后台(在浏览器中)创建视图,在这种情况下,VS项目直到包含这些视图时才真正了解它们。

The answer to this is because whatever is not included in your project, will not be released when you deploy through Visual Studio.

In a scenario where Continuous Integration exists and there are one click deployments going on with 'release' configurations (aka live environment configurations), when you right click on the project and click 'Publish' anything that's not included will be ignored from the release. That goes for models, Views, controllers, you name it.

It basically helps with big projects that have older views that you no longer needed (but for some reason the code should remain there).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM