所以我在网上搜索了一段时间可能太多了,我有一个问题找不到答案。
当创建 MVC Asp.net 项目时,它会自动生成某些文件夹、razor View 布局等。它基本上填充项目并将其与 bootstrap jquery 等链接。
当从示例创建一个空项目时,它不允许我使用 @Script
标签或 @Styles
标签,我必须手动配置 web.config
等等等等
问题是我可以创建一个没有所有 razor View 和布局但链接和配置所有内容的项目吗?我可能不需要所有注册登录 View ,删除它们也需要配置。
最佳答案
您可以创建自定义项目模板 - 请参阅 here说明:
To create a custom project template with the standard Export Template wizard
Create a project.
Edit the project until it is ready to be exported as a template.
As appropriate, edit the code files to indicate where parameter replacement should take place. For more information on parameter replacement, see How to: Substitute Parameters in a Template.
On the
File
menu, clickExport Template
. TheExport Template
wizard opens.Click
Project Template
.If you have more than one project in your current solution, select the projects you want to export to a template.
Click
Next
.Select an icon and a preview image for your template. These will appear in the
New Project
dialog box.Enter a template name and description.
Click
Finish
. Your project is exported into a .zip file and placed in the specified output location, and, if selected, imported into Visual Studio.If you have the Visual Studio SDK installed, you can wrap the finished template in a .vsix file for deployment by using the VSIX Project template. For more information, see Getting Started with the VSIX Project Template.
关于c# - MVC 创建已配置的空 mvc 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37514152/