<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotnetslackers.com/Community/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Brian Mains Blog : Frameworks</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Frameworks/default.aspx</link><description>Tags: Frameworks</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 SP1 (Build: 30415.43)</generator><item><title>Encrypting or Decrypting the Configuration File</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2009/02/04/encrypting-or-decrypting-the-configuration-file.aspx</link><pubDate>Wed, 04 Feb 2009 14:08:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:30596</guid><dc:creator>bmains</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/bmains/rsscomments.aspx?PostID=30596</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/bmains/archive/2009/02/04/encrypting-or-decrypting-the-configuration-file.aspx#comments</comments><description>&lt;p&gt;Since .NET 2.0 and Visual Studio 2005, the ability to encrypt the config file has been possible.&amp;nbsp; This functionality is built-in to the aspnet_regiis.exe utility.&amp;nbsp; This executable uses flags to designate a few items:&lt;/p&gt;
&lt;p&gt;-pe for encrypting web projects registered with IIS&lt;br /&gt;-pd for decrypting web projects registered with IIS&lt;br /&gt;-pef for encrypting web&amp;nbsp;projects using the Cassini (local)&amp;nbsp;web server&lt;br /&gt;-pdf for decrypting web projects using the Cassini (local) web server&lt;br /&gt;-app for specifying the IIS registered virtual&lt;/p&gt;
&lt;p&gt;To encrypt the connection strings settings, use the following approach:&lt;/p&gt;
&lt;p&gt;aspnet_regiis -pe &amp;quot;connectionStrings&amp;quot; -app &amp;quot;/Virtual&amp;quot;&lt;br /&gt;aspnet_regiis -pef &amp;quot;connectionStrings&amp;quot; &amp;quot;c:\websites\virtual&amp;quot;&lt;br /&gt;&lt;br /&gt;To decrypt, use the following:&lt;/p&gt;
&lt;p&gt;aspnet_regiis -pd &amp;quot;connectionStrings&amp;quot; -app &amp;quot;/Virtual&amp;quot;&lt;br /&gt;aspnet_regiis -pdf &amp;quot;connectionStrings&amp;quot; &amp;quot;c:\websites\virtual&amp;quot;&lt;br /&gt;&lt;br /&gt;This can be run even when Visual Studio is open; you&amp;#39;ll be prompted that the file changed and do you want to reload it.&lt;/p&gt;
&lt;p&gt;The difficult aspect to this is that the account that encrypts the password has to decrypt it, or you will get the &amp;quot;unable to descrypt connection strings error.&amp;quot;&amp;nbsp; Obviously, this is impractical.&amp;nbsp; The way to get get around this is to add the account that will run the ASP.NET application (for IIS 5.1 on XP, this is the ASPNET account, but in Windows Server 2003 and IIS 6,&amp;nbsp;it&amp;#39;s the NETWORKSERVICE account).&amp;nbsp; To grant permissions for these accounts to decrypt the connection string in the application, use:&lt;/p&gt;
&lt;p&gt;aspnet_regiis -pa &amp;quot;NetFrameworkConfigurationKey&amp;quot; &amp;quot;NT AUTHORITY\NETWORK SERVICE&amp;quot;&lt;/p&gt;
&lt;p&gt;See more about this at:&amp;nbsp; &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/yxw286t2.aspx" class="null"&gt;http://msdn.microsoft.com/en-us/library/yxw286t2.aspx&lt;/a&gt;.&amp;nbsp; This grants the account permissions, and the automatic decryption can works successfully.&lt;/p&gt;
&lt;p&gt;You do not need to write any code to decrypt the values; these values are automatically decrypted, with no apparent performance issues.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=30596" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Frameworks/default.aspx">Frameworks</category><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>Deploying Changes to an ASP.NET Site</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2006/10/07/Deploying-Changes-to-an-ASP.NET-Site.aspx</link><pubDate>Sat, 07 Oct 2006 04:31:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:627</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/bmains/rsscomments.aspx?PostID=627</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/bmains/archive/2006/10/07/Deploying-Changes-to-an-ASP.NET-Site.aspx#comments</comments><description>I deployed changes to a site, and it turns out I had an error in the configuration file.&amp;nbsp; I made a change, deployed the new file, and still had an error.&amp;nbsp; I tried to figure out what it was; the error messaged showed the new configuration file, but still had the same previous error.&amp;nbsp; In deploying all my ASP.NET pages, it reloaded the compiled files for the pages, and used the new configuration, correcting the problem.&amp;nbsp; I had remembered some about this from reading Dino Esposito&amp;#39;s book; because the site wasn&amp;#39;t recompiled, it was still using my previous configuration file.&amp;nbsp; Still seems strange though.&lt;br /&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=627" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Frameworks/default.aspx">Frameworks</category></item><item><title>Encrypting the Connection String</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2006/10/07/Encrypting-the-Connection-String.aspx</link><pubDate>Sat, 07 Oct 2006 04:26:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:626</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/bmains/rsscomments.aspx?PostID=626</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/bmains/archive/2006/10/07/Encrypting-the-Connection-String.aspx#comments</comments><description>&lt;p&gt;If you need to encrypt or decrypt the connection string, I found a great resource that you can access.&amp;nbsp; It is available on:&amp;nbsp; &lt;a href="http://aspnet.4guysfromrolla.com/articles/021506-1.aspx" target="_blank"&gt;http://aspnet.4guysfromrolla.com/articles/021506-1.aspx&lt;/a&gt;.&amp;nbsp; It shows you how to do it programmatically, and through the aspnet_regiis utility.&lt;/p&gt;&lt;p&gt;One point to note; I used the RSA provider, and I got an error when deploying to a remote host.&amp;nbsp; I don&amp;#39;t know if the encryption needs to be established on the remote server, or if it was that the provider was not installed on the host machine.&amp;nbsp; I can&amp;#39;t think it would be the latter, so ensure that it works before you deploy.&amp;nbsp;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=626" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Frameworks/default.aspx">Frameworks</category></item><item><title>UrlMappings Element</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2006/09/05/UrlMappings-Element.aspx</link><pubDate>Tue, 05 Sep 2006 16:04:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:501</guid><dc:creator>bmains</dc:creator><slash:comments>392</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/bmains/rsscomments.aspx?PostID=501</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/bmains/archive/2006/09/05/UrlMappings-Element.aspx#comments</comments><description>&lt;p&gt;I was excited to see the &amp;lt;urlMappings&amp;gt; element.&amp;nbsp; When enabled, you can specify url&amp;#39;s that when entered into the browser will redirect to another page.&amp;nbsp; For example, take the following section:&lt;/p&gt;&lt;p&gt;&amp;lt;urlMappings enabled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add url=&amp;quot;~/link.aspx&amp;quot; mappedUrl=&amp;quot;~/newlink.aspx&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add url=&amp;quot;~/weather.aspx&amp;quot; mappedUrl=&amp;quot;~/info.aspx?section=weather&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/urlMappings&amp;gt;&lt;/p&gt;&lt;p&gt;While not the best examples, they illustrate the point.&amp;nbsp; When you go to link.aspx, newlink.aspx will display; however, link.aspx will show in the browser.&amp;nbsp; You can also use this to hide querystring values, so that when you go to weather.aspx page, the right querystring value is provided.&lt;/p&gt;&lt;p&gt;More information is available at:&amp;nbsp; &lt;a href="http://msdn2.microsoft.com/en-us/library/ms228302.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms228302.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=501" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Web/default.aspx">Web</category><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Frameworks/default.aspx">Frameworks</category></item><item><title>.NET Framework Recognizing Changes</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2006/08/29/469.aspx</link><pubDate>Tue, 29 Aug 2006 23:56:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:469</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/bmains/rsscomments.aspx?PostID=469</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/bmains/archive/2006/08/29/469.aspx#comments</comments><description>I was working with my application the other day, and upon saving a page, without closing the browser, I realized that the framework detected the change immediately and automatically.&amp;nbsp; I was astonished at how that worked; I could tell it was working because you could see it was taking a lot longer to process the page, like it usually does when you first load the application.&lt;br&gt;&lt;br&gt;I saw about this reading Dino Esposito's Programming Microsoft ASP.NET 2.0 Advanced Applications.&amp;nbsp; Upon compilation on the first page load, the page is compiled, which it notes the file dependencies.&amp;nbsp; Upon updating the page assembly, it is renamed with a ".delete" extension, which is OK to do and won't cause an error.&amp;nbsp; This occurs every time that the page assembly is updated, up to a maximum number of times (set in the web.config file), and then the application is restarted.&lt;br&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=469" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Frameworks/default.aspx">Frameworks</category></item></channel></rss>