<?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>Ellis Web &#187; asp.net</title>
	<atom:link href="http://ellisweb.net/category/code/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://ellisweb.net</link>
	<description>Thoughts, Articles &#38; Links on Programming &#38; Technology by Yaakov Ellis</description>
	<lastBuildDate>Wed, 21 Apr 2010 07:01:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Fixing the &#8220;circular file references are not allowed&#8221; Error in ASP.net</title>
		<link>http://ellisweb.net/2009/12/fixing-the-circular-file-references-are-not-allowed-error-in-asp-net/</link>
		<comments>http://ellisweb.net/2009/12/fixing-the-circular-file-references-are-not-allowed-error-in-asp-net/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 09:41:06 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[circular]]></category>
		<category><![CDATA[error]]></category>

		<guid isPermaLink="false">http://ellisweb.net/?p=433</guid>
		<description><![CDATA[If you get the &#8220;circular file references are not allowed&#8221; error in an ASP.net Website Project and you do not have any controls that have any obvious circular references, what does the error mean and how do you fix it? See this blog post from Siderite Zackwehdex as well as this MSDN forum post: by [...]]]></description>
			<content:encoded><![CDATA[<p>If you get the &#8220;<em>circular file references are not allowed</em>&#8221; error in an ASP.net Website Project and you do not have any controls that have any obvious circular references, what does the error mean and how do you fix it?</p>
<p>See this <a href="http://siderite.blogspot.com/2007/09/circular-file-references-are-not.html">blog post</a> from Siderite Zackwehdex as well as this <a href="http://forums.asp.net/t/922622.aspx">MSDN forum post</a>: by default, in a Website Project, ASP.net compiles one dll per folder in an ASP.net project. So if you have the following setup:</p>
<p style="padding-left: 30px;">/folder1/Control1.ascx &gt; References Control2<br />
/folder2/Control2.ascx &gt; References Control3<br />
/folder1/Control3.ascx</p>
<p>This means that the folder1 dll will reference the folder2 dll which will again reference the folder1 dll, causing a &#8220;circular file reference&#8221;.</p>
<p>Ways to fix it:</p>
<ol>
<li>Rearrange the layout of your controls (or masterpages) to remove the circular references (normally this will mean moving one control to another folder &#8211; in the example above, move control2 to folder1). This is the preferred solution.</li>
<li>Use batch=&#8221;false&#8221; in the <a href="http://msdn.microsoft.com/en-us/library/s10awwz0.aspx">compilation</a> tag of the web.config file. This will cause a new dll to be created for each control/page in the site. This should fix the error but is really lousy for performance, so it should be avoided (especially on production sites).</li>
</ol>
<p>(This has happened to me a couple of times already, so posting it here as a reminder to myself for the next time).
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2009%2F12%2Ffixing-the-circular-file-references-are-not-allowed-error-in-asp-net%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2009%2F12%2Ffixing-the-circular-file-references-are-not-allowed-error-in-asp-net%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2009/12/fixing-the-circular-file-references-are-not-allowed-error-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Repeater Failure and Disappearance on Row 28</title>
		<link>http://ellisweb.net/2007/08/repeater-failure-and-disappearance-on-row-28/</link>
		<comments>http://ellisweb.net/2007/08/repeater-failure-and-disappearance-on-row-28/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 07:47:46 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[repeater]]></category>

		<guid isPermaLink="false">http://ellisweb.net/2007/08/repeater-failure-and-disappearance-on-row-28/</guid>
		<description><![CDATA[I was working on an ASP.net application (1.1) the other day, changing the UI display of a page. This page basically consisted of a Repeater being populated with data from the DB, and binding javascript actions and styling info to the different rows to be output (each overall it was producing a Table, and each [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on an ASP.net application (1.1) the other day, changing the UI display of a page. This page basically consisted of a Repeater being populated with data from the DB, and binding javascript actions and styling info to the different rows to be output (each overall it was producing a Table, and each item was a TableRow). Although the look-and-feel was going to be changing, as well as the manner in which the data was to be retrieved, the actual data set up and binding was to remain the same as it had been. Piece of cake, right?</p>
<p>The programming was straight-forward enough. When I first tested the feature on a few records, it worked fine. However, when I tested it on more records, it didn&#8217;t work. And when I say that it didn&#8217;t work, I am not saying that I got back some ugly .Net exception. I mean that the HTML output by the server was completely devoid of the Repeater element. It was as if it just did not exist. Somehow, when I tried the load the page with a large number of records,  some weired thing happened in IIS that just completely abandoned the rendering of the Repeater element without even providing an error message. Completely weird.</p>
<p>After a couple of hours of debugging, I was able to determine that the error was not related to any specific data item. Rather, it always happened when outputting the 28th DataItem in the Repeater. 27 worked fine. 28 killed it. Racking my brain (and Google), I couldn&#8217;t find any reason why this would be happening. This exact same repeater worked fine on other pages, on the live site. There was no reason I could think of why this type of failure would happen, and why it would happen here.</p>
<p>My coworker SeanS suggested that perhaps this was related to my dev environment, perhaps some faulty memory or something like that. There was nothing else to go on and this <em>did</em> explain what was going on (and I knew that the feature worked for &lt;28 rows), so I proceeded with development. And lo and behold, when I uploaded my changes to the staging site yesterday, it worked with any number of rows without any hitch-up.</p>
<p>Moral of the story: weird things happen on web servers and on dev machines. Not every error that you get is related to code (especially if the error is reported by the absence of output rather than an exception). If something like this is happening to you (and it is not reproducible on other platforms), it may very well be environment-related. Test this out before wasting more time and energy trying to sort it out through the code.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2007%2F08%2Frepeater-failure-and-disappearance-on-row-28%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2007%2F08%2Frepeater-failure-and-disappearance-on-row-28%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2007/08/repeater-failure-and-disappearance-on-row-28/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Porting .Net Assemblies to Mono using MoMA</title>
		<link>http://ellisweb.net/2006/11/porting-net-assemblies-to-mono-using-moma/</link>
		<comments>http://ellisweb.net/2006/11/porting-net-assemblies-to-mono-using-moma/#comments</comments>
		<pubDate>Tue, 28 Nov 2006 17:00:42 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[moma]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[mono migration analyzer]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://ellisweb.net/2006/11/porting-net-assemblies-to-mono-using-moma/</guid>
		<description><![CDATA[For those who have not heard about it, Mono is a platform designed to allow porting of .Net-based applications to nearly every computing platform available (including Linux and Mac). It is open-source (sponsored by Novell) and is an essential tool for any developer who wishes to run .Net code on a non-Windows OS. I am [...]]]></description>
			<content:encoded><![CDATA[<p>For those who have not heard about it, <a href="http://www.mono-project.com/Main_Page">Mono</a> is a platform designed to allow porting of .Net-based applications to nearly every computing platform available (including Linux and Mac). It is open-source (sponsored by Novell) and is an essential tool for any developer who wishes to run .Net code on a non-Windows OS.</p>
<p>I am right now in the middle of a Desktop project being written with VS.net 2005, C# and Windows Forms technology. The powers-that-be (ie: the clients) have inquired to the feasibility of potentially porting over the code to Mac or Linux. My answer has been that if it is possible, we will have to use Mono to do it, but I cannot say anything more about its compatibility until more of the programming work is completed.</p>
<p>The process of porting over a completed .Net Assembly to Mono just got a bit easier. A tool called <a href="http://www.mono-project.com/MoMA">MoMA</a> (Mono Migration Analyzer) has been released (written by Jonathan Pobst) that will do the following: given any .Net assembly (.dll or .exe file) it will go through the file and report back any potential issues that may arise using the assembly with Mono (most likely a .Net 2.0 feature that has not yet been implemented, or a calls to Win32 APIs that are not documented in the .Net API). Definitely a very helpful tool in debugging a .Net aseembly that refuses to compile in Mono.</p>
<p>Miguel de Icaza gives a more thorough <a href="http://tirania.org/blog/archive/2006/Nov-27.html">step-by-step guide</a> and review of his experiences using MoMA (though it doesn&#8217;t seem to be too complicated).
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2006%2F11%2Fporting-net-assemblies-to-mono-using-moma%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2006%2F11%2Fporting-net-assemblies-to-mono-using-moma%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/11/porting-net-assemblies-to-mono-using-moma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What would Raymond Chen say?</title>
		<link>http://ellisweb.net/2006/09/what-would-raymond-chen-say/</link>
		<comments>http://ellisweb.net/2006/09/what-would-raymond-chen-say/#comments</comments>
		<pubDate>Thu, 28 Sep 2006 10:13:32 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[joel spolsky]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[raymond chen]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.ellisweb.net/2006/09/what-would-raymond-chen-say/</guid>
		<description><![CDATA[I just read a post from Karl Seguin on CodeBetter (quoting Frans, who quoted Soma) that Visual Studio 2002 and 2003 will not run on Windows Vista. Or to quote Soma directly: However, we will not support Visual Studio .NET 2002 or Visual Studio .NET 2003 as development environments on Windows Vista. You can continue [...]]]></description>
			<content:encoded><![CDATA[<p>I just read a <a href="http://codebetter.com/blogs/karlseguin/archive/2006/09/27/Vista-can_2700_t-run-VS.NET-2003.aspx">post from Karl Seguin</a> on CodeBetter (quoting <A href="http://weblogs.asp.net/fbouma/archive/2006/09/27/So_2C00_-VB6-is-more-important-than-VS.NET-2003-I-suppose_3F00_.aspx">Frans</a>, who quoted <a href="http://blogs.msdn.com/somasegar/archive/2006/09/26/772250.aspx">Soma</a>) that Visual Studio 2002 and 2003 will not run on Windows Vista. Or to quote Soma directly:</p>
<blockquote><p>However, we will not support Visual Studio .NET 2002 or Visual Studio .NET 2003 as development environments on Windows Vista.  You can continue to use Visual Studio .NET 2002 or 2003 on Windows XP to develop applications that can run on Windows Vista.</p></blockquote>
<p>And how will they be ensuring that VS 2005 is a great development platform for Vista?</p>
<blockquote><p>Visual Studio 2005 SP1 will run on Vista but will likely have a few compatibility issues.</p></blockquote>
<p>Uh huh. So the premier IDE for Microsoft development will work on the Vista with &#8220;a few compatibility issues&#8221;, while the only good IDEs for developing and maintaining ASP.net 1.1 applications will just not work. At all.</p>
<p>What were they thinking?</p>
<p>It looks like Joel Spolsky&#8217;s analysis of the situation within Microsoft has really come true. In <a href="http://www.joelonsoftware.com/articles/APIWar.html">How Microsoft Lost the API War</a>, Joel identified two camps within Microsoft: the Raymond Chen camp, committed to maintaining software compatibility between versions of the operating system, even if it meant inserting custom API hacks just to make sure that a poorly-programmed SimCity would still work. Said <a href="http://blogs.msdn.com/oldnewthing/archive/2003/10/15/55296.aspx">Raymond</a>:</p>
<blockquote><p>I could probably write for months solely about bad things apps do and what we had to do to get them to work again (often in spite of themselves). Which is why I get particularly furious when people accuse Microsoft of maliciously breaking applications during OS upgrades. If any application failed to run on Windows 95, I took it as a personal failure. I spent many sleepless nights fixing bugs in third-party programs just so they could keep running on Windows 95.</p></blockquote>
<p>This attitude towards maintaining program compatibility <a href="http://blogs.msdn.com/oldnewthing/archive/2003/12/24/45779.aspx">continued through XP</a>. And we are not talking about Microsoft-developed applications, intended to make Microsoft more money. We are talking about third-party games, VB6 apps, old DOS console apps. You name it.</p>
<p>The other camp is the &#8220;MSDN Camp&#8221; &#8211; eternally committed to releasing (and rereleasing, and patching) the newest and greatest technology, compatibility be damned. And as Joel pointed out, starting with VB 6.0 to VB.net, IIS 5.0 to IIS 6.0, new Microsoft products were no longer fully compatible with old ones.</p>
<p>Which brings us to today. Microsoft has made the decision to completely abandon a program which is still used by a very large number (if not most) of programmers who develop for Microsoft technology. <a href="http://blogs.msdn.com/somasegar/archive/2006/09/26/772250.aspx">Why</a>?</p>
<blockquote><p>Given the customer feedback that we&#8217;ve received since the launch of Visual Studio 2005 indicating the manageability of upgrading from Visual Studio .NET 2003 to Visual Studio 2005, we are focusing our efforts on ensuring VS 2005 is a great development platform for Vista.</p></blockquote>
<p>Thanks Soma. But no thanks. The migration from Asp.net 1.1 to 2.0 does not work flawlessly. And even if it did (which is probably never, for many of the very complicated webapps out there coded in 1.1), why should we? Why risk breaking something that is already working? In order to use Visual Studio 2005 on Vista, which will hopefully not have too many &#8220;compatibility issues&#8221;, and will hopefully be able to handle all of our programming needs (covering any .Net framework, as long as it is 2.0)? </p>
<p>No thanks. Personally, unless something drastic changes, I don&#8217;t see myself switching from XP to Vista for some time to come. And I am sure that I will not be alone.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2006%2F09%2Fwhat-would-raymond-chen-say%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2006%2F09%2Fwhat-would-raymond-chen-say%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/09/what-would-raymond-chen-say/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title> Error when sending Html Mail from ASP.net WebApp</title>
		<link>http://ellisweb.net/2006/09/error-when-sending-html-mail-from-aspnet-webapp/</link>
		<comments>http://ellisweb.net/2006/09/error-when-sending-html-mail-from-aspnet-webapp/#comments</comments>
		<pubDate>Wed, 27 Sep 2006 10:10:55 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.ellisweb.net/2006/09/error-when-sending-html-mail-from-aspnet-webapp/</guid>
		<description><![CDATA[On an ASP.net site (1.1), I was trying to send an email message using good old SmtpMail.Send(MailMessage message). When I did so, I got the following message &#8220;could not access CDO.message object&#8220;. After some Googling, I tried out all of the different security/smtp/relary/permissions related suggestions (most can be found on the systemwebmail.com site, a very [...]]]></description>
			<content:encoded><![CDATA[<p>On an ASP.net site (1.1), I was trying to send an email message using good old SmtpMail.Send(MailMessage message). When I did so, I got the following message &#8220;<strong>could not access CDO.message object</strong>&#8220;. After some Googling, I tried out all of the different security/smtp/relary/permissions related suggestions (most can be found on the <a href="http://www.systemwebmail.com/faq/4.2.aspx">systemwebmail.com</a> site, a very handy reference if you have some questions regarding use of the System.Web.Mail library in ASP.net 1.1). Still not working. I checked the InnerException. It looked something like this:</p>
<blockquote><p>InnerException: {&#8220;Unknown Error&#8221; }<br />
    Message: &#8220;Exception has been thrown by the target of an invocation.&#8221;<br />
    Source: &#8220;mscorlib&#8221;<br />
    StackTrace:<br />
    &#8221;   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)\r\n<br />
    at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)\r\n<br />
    at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)\r\n<br />
    at System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj, String propName, Object propValue)\r\n<br />
    at System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String propName, Object propValue)&#8221;</p></blockquote>
<p>But nothing apparently wrong there. The one weird thing that I could find is that if I set MailMessage.BodyFormat = MailFormat.Html, it would not work. If I set it to MailFormat.Text, it would work fine. Very suspicious.</p>
<p>In the end, the following solution worked for me. It was posted by Kyle Parker on the <a href="http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/110/threadid/64614/scope/posts/Default.aspx">DotNetNuke forums</a>:</p>
<ol>
<li>Close Visual Studio</li>
<li>Open a Command Window</li>
<li>regsvr32 cdosys.dll /u</li>
<li>iisreset /restart</li>
<li>regsvr32 cdosys.dll</li>
<li>resume work in VS</li>
</ol>
<p>After unregistering and reregistering this DLL, suddenly I was able to send Html mail again from my site. Kyle reported on his post that this only worked as a temporary solution. It is working for me so far.</p>
<p>Anyone know why this happened? Some other program messed up the dll that handles Html mail?
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2006%2F09%2Ferror-when-sending-html-mail-from-aspnet-webapp%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2006%2F09%2Ferror-when-sending-html-mail-from-aspnet-webapp%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/09/error-when-sending-html-mail-from-aspnet-webapp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Programatic access to the ConnectionStrings section of your Web.Config file in ASP.net 2.0</title>
		<link>http://ellisweb.net/2006/06/programatic-access-to-the-connectionstrings-section-of-your-webconfig-file-in-aspnet-20/</link>
		<comments>http://ellisweb.net/2006/06/programatic-access-to-the-connectionstrings-section-of-your-webconfig-file-in-aspnet-20/#comments</comments>
		<pubDate>Tue, 27 Jun 2006 13:31:44 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[connectionstrings]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">http://www.ellisweb.net/2006/06/programatic-access-to-the-connectionstrings-section-of-your-webconfig-file-in-aspnet-20/</guid>
		<description><![CDATA[Back with ASP.net 1.1, if you set a connection string in your Web.config file, you could set it with something like this: &#60;appSettings&#62; &#60;add key="ConnectionStringName" value="ConnectionStringData" /&#62; &#60;/appSettings&#62; and get access to the string in your code with something like this: string connString = System.Configuration.ConfigurationSettings.AppSettings["ConnectionStringName"]; With ASP.net 2.0, while you can still use appsettings if [...]]]></description>
			<content:encoded><![CDATA[<p>Back with ASP.net 1.1, if you set a connection string in your Web.config file, you could set it with something like this:</p>
<pre class="xml:nocontrols" name="code">&lt;appSettings&gt;
  &lt;add key="ConnectionStringName" value="ConnectionStringData" /&gt;
&lt;/appSettings&gt;</pre>
<p>and get access to the string in your code with something like this:</p>
<pre class="xml:nocontrols" name="code">string connString = System.Configuration.ConfigurationSettings.AppSettings["ConnectionStringName"];</pre>
<p>With ASP.net 2.0, while you can still use <em>appsettings</em> if you so desire, there are now subsections allowed in the Web.config, one of which is set aside for database connection strings. Here is how to use it:</p>
<pre class="xml:nocontrols" name="code">&lt;connectionStrings&gt;
  &lt;add name="ConnectionStringName" connectionString="ConnectionStringDetails"/&gt;
&lt;/connectionStrings&gt;</pre>
<p>The good news with this is that the connection string within your Web.config file is no longer just some string (that while you may know it is a connection string, your application has no intrinsic knowledge of this). Your website can now access this string in a number of different ways, in general making your life easier (especially when using the Website Configuration screens, or any of the built-in data access controls).</p>
<p>All of this is old news. However, while the process for retrieving a connection string in 2.0 is well-documented when you are doing it from within the setup wizard of a DataAccess control, I had some trouble figuring out how to retrieve it solely within the code. Eventually (with some help from Google) I was able to find the exact syntax, and I am passing it on here so that it might help someone else facing the same problem.</p>
<pre class="xml:nocontrols" name="code">string conn =  System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStringName"].ConnectionString;</pre>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2006%2F06%2Fprogramatic-access-to-the-connectionstrings-section-of-your-webconfig-file-in-aspnet-20%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2006%2F06%2Fprogramatic-access-to-the-connectionstrings-section-of-your-webconfig-file-in-aspnet-20%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/06/programatic-access-to-the-connectionstrings-section-of-your-webconfig-file-in-aspnet-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Server Failed to Load Application</title>
		<link>http://ellisweb.net/2006/05/the-server-failed-to-load-application/</link>
		<comments>http://ellisweb.net/2006/05/the-server-failed-to-load-application/#comments</comments>
		<pubDate>Thu, 18 May 2006 09:26:17 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[windows forms]]></category>
		<category><![CDATA[crystal reports]]></category>
		<category><![CDATA[dtc]]></category>
		<category><![CDATA[event viewer]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.ellisweb.net/2006/05/the-server-failed-to-load-application/</guid>
		<description><![CDATA[Due to some bad problems with my main machine, I have been in the process of bringing my backup laptop (Inspiron 5150, 768mb RAM, almost three years old, recently reformatted) up to speed for my development needs. This included installing Crystal Advanced Developer 10 (required for one of the ASP.net webapps that I am doing [...]]]></description>
			<content:encoded><![CDATA[<p>Due to some bad problems with my main machine, I have been in the process of bringing my backup laptop (Inspiron 5150, 768mb RAM, almost three years old, recently reformatted) up to speed for my development needs. This included installing Crystal Advanced Developer 10 (required for one of the ASP.net webapps that I am doing maintenance on).</p>
<p>So I installed it, as I have done on a number of computers in the past. I then went and tried to run browse the webapp in question (using http://localhost/appName) and received an HTTP 500 error (IE7 politely told me that this indicated a server error, and that the website might be under maintenance).</p>
<p>I tried loading a totally different webapp that had nothing to do with Crystal. Same error. Reboot, same error. Not good.</p>
<p>So I looked in the System Event Viewer, and saw a bunch of the following warnings:</p>
<blockquote><p>The server failed to load application &#8216;/LM/W3SVC/1/Root/appName&#8217;. The error was &#8216;General access denied error&#8217;</p></blockquote>
<p>OK. What is that supposed to mean? And why was it killing all of my webapps?</p>
<p>After a little bit of <a href="http://www.google.com/search?q=%22The+server+failed+to+load+application+%27%2FLM%2FW3SVC%2F1%2FRoot%2F%22">Googling</a>, I found a page by Brett Hill in IIS Insider (March 2005), with one of the subsections titled: <a href="http://www.microsoft.com/technet/community/columns/insider/iisi0305.mspx#EZC">Resolving the Error: The server failed to load application&#8230;</a></p>
<blockquote><p>The most likely cause of this problem is that the DTC coordinator service has not started. If it has started, then look in the Event Viewer for a message regarding a failed logon for the IWAM_<em>servername</em> account.</p></blockquote>
<p>So I went into Services, and the <em>Distributed Transaction Coordinator</em> service was running. I stopped the service and restarted it, and <em>voila</em>, all of my sites would run again. Hopefully this situation will continue after my next reboot. If it does, the above article has some more advice on ways around this.</p>
<p>I have installed this program a number of times already on other machines without experiencing this error. Anyone know what may have caused it.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2006%2F05%2Fthe-server-failed-to-load-application%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2006%2F05%2Fthe-server-failed-to-load-application%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/05/the-server-failed-to-load-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Items of Interest: 2006.04.03</title>
		<link>http://ellisweb.net/2006/04/items-of-interest-20060403/</link>
		<comments>http://ellisweb.net/2006/04/items-of-interest-20060403/#comments</comments>
		<pubDate>Mon, 03 Apr 2006 12:02:11 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.ellisweb.net/2006/04/items-of-interest-20060403/</guid>
		<description><![CDATA[5 Tips for Enjoying the Software Development Profession &#8211; Dennis Forbes outlines what he considers some essentials for professional developers. He includes explanations, conclusions, and the message for a manager (assuming that managers are interested in keeping their employees happy) Upcoming ASP.NET Releases in April &#8211; Included on the list are goodies like a control [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://www.yafla.com/dforbes/2006/02/16.html#a268">5 Tips for Enjoying the Software Development Profession</a> &#8211; Dennis Forbes outlines what he considers some essentials for professional developers. He includes explanations, conclusions, and the  message for a manager (assuming that managers are interested in keeping their employees happy)</li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2006/03/30/441465.aspx">Upcoming ASP.NET Releases in April</a> &#8211; Included on the list are goodies like a control pack for ATLAS (with source code), VS 2005 Web Application Project, CSS Code Adaptors (get to that CSS programatically through ASP.net!) and more Data Tutorials</li>
<li><a href="http://blogs.msdn.com/tess/archive/2006/02/23/537681.aspx">ASP.NET Performance Case Study: Web Service calls taking forever</a> &#8211; Tess runs through a real case where a web-service was hanging. Goes through the debugging steps, analysis and solution</li>
<li><a href="http://weblogs.asp.net/pglavich/archive/2006/02/26/439077.aspx">SecurePasswordTextBox &#8211; A textbox that uses the SecureString class</a> &#8211; Paul Glavich provides an ASP.net textbox control that implements the SecureString class</li>
<li><a href="http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting">Standardista Table Sorting</a> &#8211; Javascript that will sort a table without reloading a page. Very cool stuff, easy to implement. Check out the demo. (Link via <a href="http://weblogs.asp.net/pleloup/archive/2006/03/05/439604.aspx">Help.net</a>)</li>
<li><a href="http://weblogs.asp.net/esanchez/archive/2006/04/03/441716.aspx">A revisit to a tiny C# shortcut</a> &#8211; Edgar does some research to follow up on <a href="http://weblogs.asp.net/esanchez/archive/2006/03/29/441431.aspx">an earlier post</a>. It turns out that the fastest way to find out if a string is null or empty is string.Length > 0.</li>
<li><a href="http://blogs.msdn.com/jmstall/archive/2006/03/31/random_interview_questions.aspx">Some practice interview questions</a> &#8211; From Mike Stall (the name says it all)</li>
<li><a href="http://www.techcrunch.com/2006/03/30/the-state-of-online-feed-readers/">The State of Online Feedreaders</a> &#8211; Frank from TechCrunch analyzes nine different online feedreaders, comparing features and overall usability.</li>
</ul>
<p>Technorati Tags: <a href="http://technorati.com/tag/software-development" rel="tag">software-development</a>, <a href="http://technorati.com/tag/asp.net" rel="tag"> asp.net</a>, <a href="http://technorati.com/tag/ATLAS" rel="tag"> ATLAS</a>, <a href="http://technorati.com/tag/CSS" rel="tag"> CSS</a>, <a href="http://technorati.com/tag/Visual-Studio-2005" rel="tag"> Visual-Studio-2005</a>, <a href="http://technorati.com/tag/textbox" rel="tag"> textbox</a>, <a href="http://technorati.com/tag/SecureString" rel="tag"> SecureString</a>, <a href="http://technorati.com/tag/Webservice" rel="tag"> Webservice</a>, <a href="http://technorati.com/tag/Performance" rel="tag"> Performance</a>, <a href="http://technorati.com/tag/feed-readers" rel="tag"> feed-readers</a>, <a href="http://technorati.com/tag/c%23" rel="tag"> c#</a>, <a href="http://technorati.com/tag/interview" rel="tag"> interview</a></p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2006%2F04%2Fitems-of-interest-20060403%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2006%2F04%2Fitems-of-interest-20060403%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/04/items-of-interest-20060403/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Paging in ASP.net 2.0</title>
		<link>http://ellisweb.net/2006/03/custom-paging-in-aspnet-20/</link>
		<comments>http://ellisweb.net/2006/03/custom-paging-in-aspnet-20/#comments</comments>
		<pubDate>Thu, 30 Mar 2006 12:14:25 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[4guys]]></category>
		<category><![CDATA[custom paging]]></category>
		<category><![CDATA[scott mitchell]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.ellisweb.net/2006/03/custom-paging-in-aspnet-20/</guid>
		<description><![CDATA[Check out Scott Mitchell&#8217;s treatment of the subject on the 4Guys website: Custom Paging in ASP.NET 2.0 with SQL Server 2005 Sorting Custom Paged Results As someone who has had to create a long stored procedure to handle custom paging in ASP.net 1.1 (create temporary table, generate query to load IDs into the table, query [...]]]></description>
			<content:encoded><![CDATA[<p>Check out Scott Mitchell&#8217;s treatment of the subject on the <a href="http://www.4guysfromrolla.com/">4Guys</a> website:</p>
<ul>
<li><a href="http://aspnet.4guysfromrolla.com/articles/031506-1.aspx">Custom Paging in ASP.NET 2.0 with SQL Server 2005</a></li>
<li><a href="http://aspnet.4guysfromrolla.com/articles/032206-1.aspx">Sorting Custom Paged Results</a></li>
</ul>
<p>As someone who has had to create a long stored procedure to handle custom paging in ASP.net 1.1 (create temporary table, generate query to load IDs into the table, query the temp table with some variables to pull out the records that you want), I am especially excited about the <a href="http://msdn2.microsoft.com/en-us/library/ms186734(sql.90).aspx">Row_Number() keyword</a> in SQL Server 2005, and the savings in development time (debugging &#038; headaches) that will come along with its proper use.</p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2006%2F03%2Fcustom-paging-in-aspnet-20%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2006%2F03%2Fcustom-paging-in-aspnet-20%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/03/custom-paging-in-aspnet-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.net 2.0 Looking Pretty Slick</title>
		<link>http://ellisweb.net/2006/03/aspnet-20-looking-pretty-slick/</link>
		<comments>http://ellisweb.net/2006/03/aspnet-20-looking-pretty-slick/#comments</comments>
		<pubDate>Tue, 28 Mar 2006 17:43:55 +0000</pubDate>
		<dc:creator>Yaakov Ellis</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[myspace]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.ellisweb.net/2006/03/aspnet-20-looking-pretty-slick/</guid>
		<description><![CDATA[First a disclaimer: I have never used Visual Studio 2005 (except for an early beta Express edition) nor have I used ASP.net 2.0 (I plan to start in the next couple of days). I have been doing lots of ASP.net programming and application development using the .Net Framework (1.14322), C#, VS 2003 and SQL Server [...]]]></description>
			<content:encoded><![CDATA[<p>First a disclaimer: I have never used <a href="msdn.microsoft.com/vstudio/">Visual Studio 2005</a> (except for an early beta Express edition) nor have I used ASP.net 2.0 (I plan to start in the next couple of days). I have been doing lots of ASP.net programming and application development using the <a href="http://msdn.microsoft.com/netframework/">.Net Framework</a> (<a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&#038;FamilyID=262D25E3-F589-4842-8157-034D1E7CF3A3">1.14322</a>), <a href="msdn.microsoft.com/vstudio/express/visualcsharp/">C#</a>, VS 2003 and SQL Server 2000. </p>
<p>That said, I am getting personally excited (in a professional way) about the improved development potential with ASP.net 2.0</p>
<p>A few things that I have seen recently that have influenced my opinion enough to write the previous sentence:</p>
<ul>
<li><a href="http://weblogs.asp.net/scottgu">Scott Guthrie</a> has posted an <a href="http://weblogs.asp.net/scottgu/archive/2006/03/25/441074.aspx">account of how MySpace is using ASP.net</a> and how switching to the new platform (fresumably from ColdFusion) affected their performance:
<ul>
<li>They are processiong 1.5 billion page views per day, reaching 2.3 concurrent users</li>
<li>After switching to ASP.net 2.0, their server utilization went down from <strong>85% to 27%</strong>!</li>
</ul>
<p>	So if you are considering the platform, you wont have to be concerned about any scaling or performance issues (assuming you know what you are doing). (I wonder how php would compare, with caching and everything else. Would it even be 50% as efficient as pre-compiled code? 30%?)
	</li>
<li>The <a href="http://atlas.asp.net">ATLAS</a> framework has just <a href="http://weblogs.asp.net/atlas/archive/2006/03/20/440631.aspx">received a go-live license</a> with its <a href="http://atlas.asp.net/default.aspx?tabid=47&#038;subtabid=471">March CTP release</a>. ATLAS is Microsoft&#8217;s version of <a href="http://en.wikipedia.org/wiki/AJAX">Ajax</a> for ASP.net. It may not be <a href="www.rubyonrails.org/">ROR</a>, but if you <a href="mms://wm.microsoft.com/ms/uifx/asp_net_atlas.wmv">check out this demonstration video</a> (worth watching for both the ATLAS demo as well as the demonstration of the new improvements to the product that make development go faster) I hope you will agree that it is definitely something worth trying out.</li>
<li>For just a quick taste of other features touched by the upgrade (as well as totally new additions), check out some of the  webcasts on the <a href="http://msdn.microsoft.com/asp.net/learning/learn/newtodevelopment/default.aspx">ASP.net Developer Center</a></li>
</ul>
<p>They may <a href="http://slashdot.org/articles/06/03/21/2331210.shtml">not ship everything on time</a>&#8230;but once <a href="http://www.microsoft.com">they</a> get their products out the door, they (often?!) can really shine.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fellisweb.net%2F2006%2F03%2Faspnet-20-looking-pretty-slick%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fellisweb.net%2F2006%2F03%2Faspnet-20-looking-pretty-slick%2F&amp;source=yaakov&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://ellisweb.net/2006/03/aspnet-20-looking-pretty-slick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
