3

So I searched the web for a while maybe too much and I have a question that I cant find the answer for.

When creating a MVC Asp.net project it auto-generates certain folders, razor views a layout etc. etc. It basically fills the project and links it with bootstrap jquery etc.

When creating an empty project from example it doesn't let me use the @Script tag or the @Styles one and I have to manually configure the web.config and etc and etc.

The question is can I create a project without all the razor views and the layout, but with all the stuff linked and configured? I may not need all the register login views and deleting them requires configuration too.

3 Answers 3

2

You can create a custom project template - See here for instructions:

To create a custom project template with the standard Export Template wizard

  1. Create a project.

  2. Edit the project until it is ready to be exported as a template.

  3. 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.

  4. On the File menu, click Export Template. The Export Template wizard opens.

  5. Click Project Template.

  6. If you have more than one project in your current solution, select the projects you want to export to a template.

  7. Click Next.

  8. Select an icon and a preview image for your template. These will appear in the New Project dialog box.

  9. Enter a template name and description.

  10. 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.

Sign up to request clarification or add additional context in comments.

Comments

2

I see this has already been answered, but it seems more complex that what I believe user6321125 is looking for. I had to do this too, so I think I understand what you mean.

The answer it to create the project again, but this time on the New Project screen, after selecting ASP.NET MVC, click "Configure authentication" and select "No authentication".

Then you will be given a clean project without all of the login views etc.

Comments

1

You have to create a Web Application with an empty template and then install MVC on the Nuget Package Manager.

Tools -> Nuget Package Manager -> Manage Nuet Packages for Solution -> Type in the Search box- MVC and Install the MVC Package.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.