I have an MVC 3 project and when I compile it (f5) it will switch to the browser and then take a long time to show me the result.
I have IIS7 installed on Windows7. But I do not know if I need to add something to IIS7 or publish my 开发者_如何学JAVAproject or etc...?
When you hit F5, your website is deployed on a development server built into Visual Studio. This website is only accessible locally, so eventually you'll have to deploy the website on your IIS.
As for the long startup time, it could be that your application does a lot of computing before rendering a page, or your development server takes a lot of time to start up and compile your pages.
Does the delay happen every time you access a page, or only the first time?
If it happens every time, you need to profile your application using some profiling tools.
If it only happens the first time, it could be that your development machine is not very powerful, and thus the built-in server takes long to compile your page.
Also, what is the 'long time' exactly? For my development server, it may take up to 2 seconds to display the page for the first time. The subsequent page accesses are instant.
精彩评论