1

I would like to use a WebSite project instead of a Web Application project for an MVC project.

What is the best way to accomplish this and are there signifigant problems that I might run into?

(as a side note, my reasoning for wanting this is because I have graphic designers who put files into SVN but they don't get added to the "project" and don't show up on deployment or deployment testing. My thought was that switching to a Web Site project might prevent this)

1
  • I think it's actually the reverse. They don't show up in the project in Web app projects automatically. They do show up in a Web site. Commented Jun 22, 2009 at 21:10

2 Answers 2

2

You don't need to do anything special if you are not using CodeBehind files (if you're using them, it'll be more complex but anyway, it's an MVC app. If you're using them, don't!). Just take an MVC Web app project and put all source files (*.cs) under App_Code directory of the Web site. That said, I fail to see any advantage for it.

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

1 Comment

The advantage is you don't have to compile the entire site every time to deploy. You will be able to update single specific files and deploy.
0

The application project allows you to use the Models folder to embed classes into. This would then be compiled for that web project. A web site does not provide for this directly. It would require that you use an assembly project to maintain all of your classes. Rather than converting from one project type to another (which I am not sure how you wold go about doing that) you can simply attach an assembly project to your web application and not store any classes in the model folder of your application.

Having said this, you should keep your web project as an application as there usually are view specific classes that are required such as a your view model classes that belong in the web project.

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.