03 December 2010 Azure, MVC Robert Muehsig

image

Nach dem Update auf das Azure 1.3 SDK konnte ich lokal meine MVC App nicht mehr starten. In der 1.2 Version ging alles und wenn ich die MVC App ohne "Azure” starte, hat sie auch funktioniert... doch nun bekam ich einen nervigen Fehler. Problemlösung: Web.config muss schreibbar sein! Scheinbar ein Bug vom SDK. Sobald die web.config readonly ist, bekommt man den Fehler.

Die Fehlermeldung in Groß:

image

Ich war etwas erstaunt, da ich eigentlich nichts mit WCF in der Applikation mache. Es ist nur eine ganz normale MVC App. Der Fehler lag daran, dass meine web.config auf readonly war (Source Control!).

Hier habe ich die Antwort von Aaron Schnieder gefunden:

FIXED!!!!!!!!!!!!!!!!!!!!!!!!

This issue drove me crazy for the last day; Microsoft owes me a beer for this fix! :) So after much weeping and gnashing of teeth, I figured out what the fix is:

Make sure your web role web.config is writable (i.e. not locked in read-only by source control or the read-only file bit.)

It looks like there is a bug in the Azure SDK 1.3 that is causing the web.config to be written to during the instantiation of the Azure dev fabric roles. If the web.config is read-only, Azure is blocked from editing the file (no actual edits take place that I can find) and the bizarro System.ServiceModel.CommunicationObjectFailedException message bubbles up.

Secondarily.... Make sure that any <system.web><httpModule> declarations are moved to <system.webServer><modules>. This was a minor issue causing a few hiccups (not the main problem), but I thought it was worth mentioning.

Hope that helps everyone.

Aaron

Jetzt geht es jedenfalls wieder lokal zu starten. Ich hoffe allerdings, dass dieser Bug in den nächsten Versionen behoben wird. Nur zum Starten ein File auschecken empfinde ich als ziemlichen Fail.

Update: Hintergrundinfos warum das so ist, sind hier zu erfahren.


Written by Robert Muehsig

Software Developer - from Saxony, Germany - working on primedocs.io. Microsoft MVP & Web Geek.
Other Projects: KnowYourStack.com | ExpensiveMeeting | EinKofferVollerReisen.de