简体   繁体   中英

Problem deploying an ASP MVC application to IIS7

I've got an ASP MVC (1.0) application. It works fine locally via visual studio and on our dev server which runs IIS6. But when I try to deploy to the Test server (running IIS7 on Windows Server 2008 R2) I get only :

"Could not load file or assembly '<ApplicationName>' or one of its dependencies. Access is denied" (where <ApplicationName> is the name of my application).  

This is followed by a "FileLoadException", a "ConfigurationErrorsException" and two "HttpException" (all with the same message as above)

I deployed via publishing to an empty directory, whose contents were then zipped and transferred to the site directory on the test server. If I copy the directories contents to my IIS installation it works fine. I've checked that networkservices has permission to access the site directories and the temporary directories, which were the solutions I found via google, but it hasn't helped. I'm completely stumped. Any ideas?

Adam

Does your server have System.Web.Mvc.dll installed in the GAC already?

If not, you'll need to mark your reference to the System.Web.Mvc.dll in your project as "Copy Local = true" before you publish. Just right click on the reference and you'll see the option. Otherwise, System.Web.Mvc won't be in your bin directory.

I wrote about this here: http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx

Well, it just got weirder when we tried a different version of our app - we went back to the "Cannot read web.config" error that we had also seen earlier and then had disappeared with the version which gave the above error. After being convinced it must be a permissions issue for a long time we eventually discovered that the web.config (and who knows what else) had been corrupted in some fashion when we zipped the app to transfer it to the server. A tar then zip and it just worked. Never had that problem with ZIP before, but I we'll just use a tar.zip going forward

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM