Click here to Skip to main content
15,888,255 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am working on asp.net mvc 4 application in Visual studio 2013.
I created a Web Setup Project to deploy the application on IIS.
Every thing was working as expected until I added a custom action to the Web Setup Project. The custom action is used to change application pool identity. But when i run the setup I get the following error.

"Error 1001, Exception occurred while initializing the installation: System.BadImageFormateException. Could not load file or assembly 'file//C:\inetpub\wwwroot\...\PoolSetup.dll or one of its dependencies. This assembly is built by runtime newer than the currently loaded runtime and cannot be loaded"

PoolSetup.dll is the class library I am calling as a Custom Action in my Web Deployment project. I was referencing to the System.DirectoryServices so I removed this reference and commented all the code inside the Install method of the Installer class. But when i rebuilt the project and installed I got the same above exception. My MVC project and the PoolSetup library are built under .Net 4.5.

Can some body help me to figure this out?

What I have tried:

I have written it in my question.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900