I have a site developed in ASP.Net MVC.
Is it possible to run the site as developed on the developing machine dire开发者_如何学编程ctly on the production server without compilation? I.e. in the /bin
folder I will only have the external DLLs that will be needed and not the project DLL.
I will commit the code from the development machine and take the working copy on the server and it should get run without any compilation. Is there any way to do this?
There are two types of projects: Web Site and Web Application.
A web site will be automatically compiled at runtime by the ASP.NET engine, meaning that you can deploy the source code in the App_Code
folder and it will compile.
On the other hand a web application needs to be compiled and the resulting assembly containing all the code will should be placed into the bin
folder. This is the default model used by ASP.NET MVC. So the only way to achieve what you are looking for is to convert your web application into a web site which I would strongly recommend you against.
What you want achieve is possible, but not in the way you want.
I would suggest using ContinousIntegration and deployment using CruiseControl.net http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET
You can set it up to monitor for changes in the repo and build only when there are changes. I do believe there was FTP functionality coming, but I dont know if it has been added yet, I havent used CC.net in about 2yrs due to the current place I work. BUT you can include a batchfile or a script of some other sort to copy the built files to your server.
OR even have CC.net on the server?
The only downside with auto deployment is you have to be VERY good with checking in working code, or have gated checkins with lots of unit tests, so if the tests fail the site doesnt get deployed.
One other option is you dev on a branch and only have CC.net build and deploy form trunk?
This wont deploy an uncompiled site, but from they way you asked your question I guess you just want to cut out the manual parts of deployment.
hope this helps.
You could publish locally and then just do a file copy to the production server. Use Visual Studio's built in Publish feature. (right click the web project and it should be in the menu). You may have to change the configuration file so that it points to your prod database and has all your production settings. I'd recommend just not copying the config file up if it's already configured correctly.
We use Beyond Compare http://www.scootersoftware.com/ to push code from the dev machine to QA/Staging/Production because it allows you to see and push individual files (either through file system shares or ftp) or folders that are different. Also, in the case of configuration changes, you can easily merge them up.
精彩评论