<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Phil Leggetter - Software Consultant &#187; ASP.NET MVC</title>
	<atom:link href="http://www.leggetter.co.uk/tag/asp-net-mvc/feed" rel="self" type="application/rss+xml" />
	<link>http://www.leggetter.co.uk</link>
	<description>Real-time web and social media software consultant</description>
	<lastBuildDate>Thu, 09 Sep 2010 14:17:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Master does not have a definition for ViewData (ASP.NET MVC2)</title>
		<link>http://www.leggetter.co.uk/2010/08/04/master-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html</link>
		<comments>http://www.leggetter.co.uk/2010/08/04/master-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html#comments</comments>
		<pubDate>Wed, 04 Aug 2010 11:05:28 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=1126</guid>
		<description><![CDATA[I'm building an ASP.NET MVC2 web application and I was  [...]


Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/07/09/wikipedia-now-has-a-definition-for-real-time-web.html' rel='bookmark' title='Permanent Link: Wikipedia now has a definition for Real-Time Web'>Wikipedia now has a definition for Real-Time Web</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m building an ASP.NET MVC2 web application and I was trying to access ViewData in my Site.Master page and I kept getting &#8220;master does not have a definition for ViewData&#8221;.</p>
<pre class="brush: xml;">&lt;%= ViewData[&quot;topic&quot;] %&gt;</pre>
<p>The simple answer was that my Master Page was not an ASP.NET MVC2 master page. Somehow I had a standard master page.</p>
<p>So, all I did was swap the existing page declaration</p>
<pre class="brush: xml;">&lt;%@ Master Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;Site.Master.cs&quot; Inherits=&quot;HubSubscriber.Views.Shared.Site&quot; %&gt;</pre>
<p>With an ASP.NET MVC2 declaration:</p>
<pre class="brush: xml;">&lt;%@ Master Language=&quot;C#&quot; Inherits=&quot;System.Web.Mvc.ViewMasterPage&quot; %&gt;</pre>
<p>And bingo! ViewData was now accessible from my master page.</p>
<p>This post on <a  href="http://www.asp.net/mvc/tutorials/passing-data-to-view-master-pages-cs">Passing Data to View Master Pages</a> may also be useful.</p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em> </em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html&amp;title=Master+does+not+have+a+definition+for+ViewData+%28ASP.NET+MVC2%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html&amp;title=Master+does+not+have+a+definition+for+ViewData+%28ASP.NET+MVC2%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html&amp;title=Master+does+not+have+a+definition+for+ViewData+%28ASP.NET+MVC2%29" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html&amp;title=Master+does+not+have+a+definition+for+ViewData+%28ASP.NET+MVC2%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html&amp;title=Master+does+not+have+a+definition+for+ViewData+%28ASP.NET+MVC2%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html&amp;title=Master+does+not+have+a+definition+for+ViewData+%28ASP.NET+MVC2%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Master+does+not+have+a+definition+for+ViewData+%28ASP.NET+MVC2%29+@+http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2010%2F08%2F04%2Fmaster-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html&amp;t=Master+does+not+have+a+definition+for+ViewData+%28ASP.NET+MVC2%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/07/09/wikipedia-now-has-a-definition-for-real-time-web.html' rel='bookmark' title='Permanent Link: Wikipedia now has a definition for Real-Time Web'>Wikipedia now has a definition for Real-Time Web</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2010/08/04/master-does-not-have-a-definition-for-viewdata-asp-net-mvc2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows Azure &#8211; 503 Service Unavailable</title>
		<link>http://www.leggetter.co.uk/2009/08/28/windows-azure-503-service-unavailable.html</link>
		<comments>http://www.leggetter.co.uk/2009/08/28/windows-azure-503-service-unavailable.html#comments</comments>
		<pubDate>Thu, 27 Aug 2009 23:44:57 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=271</guid>
		<description><![CDATA[I finally got around to trying out ASP.NET MVC and whil [...]


Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/10/06/response-redirect-in-windows-azure.html' rel='bookmark' title='Permanent Link: Response.Redirect in Windows Azure'>Response.Redirect in Windows Azure</a></li>
<li><a href='http://www.leggetter.co.uk/2009/08/26/system-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html' rel='bookmark' title='Permanent Link: System.Security.SecurityException: That assembly does not allow partially trusted callers'>System.Security.SecurityException: That assembly does not allow partially trusted callers</a></li>
<li><a href='http://www.leggetter.co.uk/2008/05/20/how-to-install-caplin-systems-liberator-free-edition-on-windows.html' rel='bookmark' title='Permanent Link: How to install Caplin Systems&#8217; Liberator Free Edition on Windows'>How to install Caplin Systems&#8217; Liberator Free Edition on Windows</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I finally got around to trying out ASP.NET MVC and while I was at it I thought I&#8217;d also give Windows Azure a whirl. Windows Azure doesn&#8217;t support ASP.NET MVC out of the box but Jim over on MSDN Blogs has written up the details of how to get <a  href="http://blogs.msdn.com/jnak/archive/2008/10/28/asp-net-mvc-projects-running-on-windows-azure.aspx">ASP.Net MVC Projects running on Windows Azure</a>.</p>
<h3>Problem</h3>
<p>So, I followed the instruction from the blog and uploaded the package and configuration file, waited for the staging application to get into a runnable state, and clicked on the staging link&#8230;</p>
<blockquote><p>Windows Azure &#8211; 503 Service Unavailable</p></blockquote>
<p>Clearly not a good thing! In addition to this error I occasionally got a random network error or a full-on connection error reported by the browser.</p>
<p>I tried googling for this error but there was nothing about this problem after deploying to the real Windows Azure hosting (the cloud). As far as I can tell there&#8217;s no way of getting any debug information or logs to work out what&#8217;s going wrong. Maybe this is something that Microsoft will add later on?</p>
<h3>Solution</h3>
<p>Then it struck me that I hadn&#8217;t actually set up any kind of TableStorage on my Windows Azure hosting so I removed all mentions of storage and database connections from the MVC application. This included editing Web.config and removing the following.</p>
<ul>
<li>The &lt;section name=&#8221;authenticationService&#8221; type=&#8221;System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&#8243; requirePermission=&#8221;false&#8221; allowDefinition=&#8221;MachineToApplication&#8221; /&gt; section element.</li>
<li>The &lt;connectionStrings&gt; element</li>
<li>The &lt;membership&gt;element</li>
<li>The &lt;authentication mode=&#8221;Forms&#8221;&gt; element</li>
<li>The &lt;profile&gt; element</li>
<li>The &lt;roleManager&gt;element</li>
</ul>
<p><strong><em>Update: I&#8217;ve found that without the &lt;authentication&gt;element I started getting the error below so you may want to instead replace it with :</em></strong></p>
<blockquote><p>CCT: Role instances did not start within the time allowed.  Please try again.  If you continue to encounter this behavior please try shutting down the Development Fabric.</p></blockquote>
<p>I&#8217;m guessing that not all of these elements actually need to be removed but doing so resulted in the MVC ASP.NET application working in Windows Azure.</p>
<p><strong><em>Update 2: ServiceDefinition.csdef</em></strong></p>
<p>If you happen to get network timeouts or 404 network connection issues it&#8217;s worth checking your ServiceDefinition.csdef to make sure that you&#8217;ve got port 80 configured. I noticed that mine had updated to port 8080 so obviously I couldn&#8217;t access the staging site on port 80 like I was trying. If you do have the port set to something else other than port 80 you can use that port to access your application but the ServiceDefinition.csdef does have a comment in there telling you your application should be on port 80 so you are probably best to stick with that.</p>
<blockquote><p>&lt;!&#8211; Must use port 80 for http and port 443 for https when running in the cloud &#8211;&gt;<br />
&lt;InputEndpoint name=&#8221;HttpIn&#8221; protocol=&#8221;http&#8221; port=&#8221;80&#8243; /&gt;</p></blockquote><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em> </em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html&amp;title=Windows+Azure+%26%238211%3B+503+Service+Unavailable" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html&amp;title=Windows+Azure+%26%238211%3B+503+Service+Unavailable" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html&amp;title=Windows+Azure+%26%238211%3B+503+Service+Unavailable" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html&amp;title=Windows+Azure+%26%238211%3B+503+Service+Unavailable" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html&amp;title=Windows+Azure+%26%238211%3B+503+Service+Unavailable" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html&amp;title=Windows+Azure+%26%238211%3B+503+Service+Unavailable" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Windows+Azure+%26%238211%3B+503+Service+Unavailable+@+http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F28%2Fwindows-azure-503-service-unavailable.html&amp;t=Windows+Azure+%26%238211%3B+503+Service+Unavailable" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/10/06/response-redirect-in-windows-azure.html' rel='bookmark' title='Permanent Link: Response.Redirect in Windows Azure'>Response.Redirect in Windows Azure</a></li>
<li><a href='http://www.leggetter.co.uk/2009/08/26/system-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html' rel='bookmark' title='Permanent Link: System.Security.SecurityException: That assembly does not allow partially trusted callers'>System.Security.SecurityException: That assembly does not allow partially trusted callers</a></li>
<li><a href='http://www.leggetter.co.uk/2008/05/20/how-to-install-caplin-systems-liberator-free-edition-on-windows.html' rel='bookmark' title='Permanent Link: How to install Caplin Systems&#8217; Liberator Free Edition on Windows'>How to install Caplin Systems&#8217; Liberator Free Edition on Windows</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2009/08/28/windows-azure-503-service-unavailable.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System.Security.SecurityException: That assembly does not allow partially trusted callers</title>
		<link>http://www.leggetter.co.uk/2009/08/26/system-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html</link>
		<comments>http://www.leggetter.co.uk/2009/08/26/system-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html#comments</comments>
		<pubDate>Tue, 25 Aug 2009 23:51:12 +0000</pubDate>
		<dc:creator>Phil Leggetter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[C# Snippets]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.leggetter.co.uk/?p=268</guid>
		<description><![CDATA[I was writing a Windows Azure ASP.NET MVC application a [...]


Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/08/28/windows-azure-503-service-unavailable.html' rel='bookmark' title='Permanent Link: Windows Azure &#8211; 503 Service Unavailable'>Windows Azure &#8211; 503 Service Unavailable</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was writing a Windows Azure ASP.NET MVC application and when making a call to a page I received the following exception:</p>
<blockquote><p>System.Security.SecurityException: That assembly does not allow partially trusted callers</p></blockquote>
<p>In my application I&#8217;m using <a  href="http://www.castleproject.org/container/index.html">Castle Windsor</a> for dependency injection and when trying to resolve a service using:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<blockquote><p>IGravatar gravatar = MvcApplication.Container.Resolve&lt;IGravatar&gt;();</p></blockquote>
<p>I received this message. To solve things I needed to update the WebRole element in the ServiceDefinitions.csdef file so that enableNativeCodeExecution is enabled.</p>
<blockquote><p>&lt;WebRole name=&#8221;TwitterGravatarMVC&#8221; enableNativeCodeExecution=&#8221;true&#8221;&gt;</p></blockquote>
<p>I found <a  href="http://social.msdn.microsoft.com/Forums/en-US/netservices/thread/c2e49731-9e72-49b6-9fb3-1243c85b265d">the solution</a>, detailed above, on the<a  href="http://social.msdn.microsoft.com/Forums/en-US/netservices/thread/c2e49731-9e72-49b6-9fb3-1243c85b265d"> Azure Services Platform Developer Centre forum</a>.</p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em> </em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html&amp;title=System.Security.SecurityException%3A+That+assembly+does+not+allow+partially+trusted+callers" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html&amp;title=System.Security.SecurityException%3A+That+assembly+does+not+allow+partially+trusted+callers" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html&amp;title=System.Security.SecurityException%3A+That+assembly+does+not+allow+partially+trusted+callers" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html&amp;title=System.Security.SecurityException%3A+That+assembly+does+not+allow+partially+trusted+callers" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html&amp;title=System.Security.SecurityException%3A+That+assembly+does+not+allow+partially+trusted+callers" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html&amp;title=System.Security.SecurityException%3A+That+assembly+does+not+allow+partially+trusted+callers" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+System.Security.SecurityException%3A+That+assembly+does+not+allow+partially+trusted+callers+@+http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.leggetter.co.uk%2F2009%2F08%2F26%2Fsystem-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html&amp;t=System.Security.SecurityException%3A+That+assembly+does+not+allow+partially+trusted+callers" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.leggetter.co.uk/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://www.leggetter.co.uk/2009/08/28/windows-azure-503-service-unavailable.html' rel='bookmark' title='Permanent Link: Windows Azure &#8211; 503 Service Unavailable'>Windows Azure &#8211; 503 Service Unavailable</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leggetter.co.uk/2009/08/26/system-security-securityexception-that-assembly-does-not-allow-partially-trusted-callers.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
