find a location for property in a new city
Showing posts with label Application pool. Show all posts
Showing posts with label Application pool. Show all posts

Thursday, 20 October 2011

Unable to remove directory. Access to the path 'mswasri.dll' is denied when packaging an Azure project

When trying to build a package using the Azure SDK built into Visual Studio 2010 I sometimes get the error message "Unable to remove directory "bin\Release\CloudPackage.csx\". Access to the path 'mswasri.dll' is denied."

This stopped me from being able to build Azure cloud package ready for deployment. I tried changing my cloud package .csx file to read only but it just changed back. I tried deleting it but it was in use.

This gave me a clue. I run my local copy of my Azure site through my local IIS. I think this was locking the site and thus preventing it from being packaged.

Solution

The way to solve this problem that I found to work best was to find the Application Pool that is running the web application in my local development environment and stop it. This allows me to successfully package my web application ready from deployment to the Azure cloud!

Follow britishdev on Twitter

Monday, 29 March 2010

There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined

I managed to get "The requested page cannot be accessed because the related configuration data for the page is invalid." errors with a config error of "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined" after trying to be clever. Here is the problem and solution.

Keen to try .NET4's new arsenal but trying to create physical separation from my current .NET3.5 (.NET2 runtime) solution, I decided to create a new ASP.NET MVC2 project and use a virtual application in IIS7, set to use the .NET4 application pool to make it appear on a /mvc subdirectory rather than an entirely new site.

Then my old friend "Yellow Screen of Death" reared his, quite frankly, ugly head and started hurling abuse at me for defining duplicate sections. He has no subtlety.

Well he is lieing! I have not added duplicates. This ungoogleable problem was causing me grief because of some complete falsity. I removed the "duplicate" from the web root web.config and then it had a problem with the next defined section. Then the next and the next. I removed them all and then it got its knickers in a twist about something else.

Time to take a step back

What am I trying to do? Run a .NET4 application from a .NET2 runtime... oh right... yeah.

I stopped my quest and started a new site in IIS for this MVC2 application, now all is well. Those errors were complete red herrings though and I suppose my head wasn't quite in gear since it was late on a Friday and there was drinking to be done!

Update:

If you are still struggling with this and you aren't using .NET v2 and v4 together there is still more help in this post about solving web.config inheritance.

Update 2:

If you are using .NET 4 as a child to a .NET 2 parent application then you will need to read this to solve all your problems :) ASP.NET 4 Child Applications Fail to Start When Under ASP.NET 2.0 or ASP.NET 3.5 Applications

Follow britishdev on Twitter

Wednesday, 24 March 2010

Unrecognized attribute 'targetFramework' when upgrading to .NET 4

I received and error saying "Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive." with a description of "An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately."

Unlike .NET v3 and v3.5 which were essentially extensions to v2. .NET4 is an entirely self contained brand spanking new (and much lighter) framework. As such you will need to change your application pool like so:

Go to IIS and find the Application Pool you are using. Right click it and select Basic Settings then simply change the target framework to .NET Framework v4 as illustrated.

Follow britishdev on Twitter