<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/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/" xmlns:cs="http://blogs.iis.net/"><channel><title>Search results matching tags 'Code' and 'Visual Studio'</title><link>http://blogs.iis.net/search/SearchResults.aspx?o=DateDescending&amp;tag=Code,Visual+Studio&amp;orTags=0</link><description>Search results matching tags 'Code' and 'Visual Studio'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Debugging .NET Framework Source Code</title><link>http://blogs.iis.net/tomchris/archive/2008/05/13/debugging-net-framework-source-code.aspx</link><pubDate>Tue, 13 May 2008 12:45:10 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2354800</guid><dc:creator>Anonymous</dc:creator><cs:applicationKey>tomchris</cs:applicationKey><description>&lt;p&gt;I am not sure how many people are familiar with the .NET Reference Source project, but if you do a lot of debugging of .NET code, chances are that you have had a situation where you wanted to be able to step into the .NET Source from within Visual Studio.&lt;/p&gt;  &lt;p&gt;Well, thanks to this project.&amp;#160; This is now something that you can accomplish.&amp;#160; It just takes a few steps and you will be off and running.&lt;/p&gt;  &lt;p&gt;I don’t want to go into the specific steps to get this setup as Shawn did a fantastic job explaining them on his blog &lt;a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx"&gt;here&lt;/a&gt;.&amp;#160; This is also mentioned on &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx"&gt;ScottGu’s blog&lt;/a&gt; with another example.&lt;/p&gt;  &lt;p&gt;This is a big win for everyone.&amp;#160; If you have any problems with this and Shawn’s blog doesn’t have your issue documented, feel free to post it here or on the &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=2019&amp;amp;SiteID=1"&gt;MSDN Forum&lt;/a&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Keep in mind that you view this through a read-only reference license so feel free to look at the code.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.msdn.com%2ftom%2farchive%2f2008%2f05%2f13%2fdebugging-net-framework-source-code.aspx"&gt;&lt;img border="0" alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.msdn.com%2ftom%2farchive%2f2008%2f05%2f13%2fdebugging-net-framework-source-code.aspx" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8500106" width="1" height="1"&gt;</description></item><item><title>Visual Studio Designer not Respecting Assembly Binding Redirection</title><link>http://blogs.iis.net/tomchris/archive/2008/04/24/visual-studio-designer-not-respecting-assembly-binding-redirection.aspx</link><pubDate>Thu, 24 Apr 2008 19:16:33 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2319889</guid><dc:creator>Anonymous</dc:creator><cs:applicationKey>tomchris</cs:applicationKey><description>&lt;p&gt;So we recently came across an issue where Visual Studio 2005 and 2008 Designers were not respecting assembly binding redirection.&lt;/p&gt;  &lt;h3&gt;Scenario&lt;/h3&gt;  &lt;p&gt;We have a file which is now version 2 and stored in the &lt;a href="http://msdn2.microsoft.com/en-us/library/yf1d93sz.aspx"&gt;GAC&lt;/a&gt;.&amp;#160; So the assembly version is 2.0.0.0.&amp;#160; We have some existing customers using version 1 so we want to be able to use &lt;a href="http://msdn2.microsoft.com/en-us/library/2fc472t2.aspx"&gt;Assembly Binding Redirection&lt;/a&gt; to point them to the new version of the assembly.&lt;/p&gt;  &lt;p&gt;For more information on configuring this, check out &lt;a href="http://msdn2.microsoft.com/en-us/library/433ysdt1.aspx"&gt;Configuring Assembly Binding Redirection&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The web page has code like:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tc:TestContacts&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;QuickContacts1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tc:AContact&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Test Tester&amp;quot;&lt;/span&gt; 
        &lt;span class="attr"&gt;Email&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;test@test.com&amp;quot;&lt;/span&gt; 
        &lt;span class="attr"&gt;Phone&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;(999) 555-1212&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tc:AContact&lt;/span&gt; &lt;span class="attr"&gt;Email&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;no@spam.thx&amp;quot;&lt;/span&gt; 
        &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Mr. A. Nonymous&amp;quot;&lt;/span&gt; 
        &lt;span class="attr"&gt;Phone&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;(999) 555-1234&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;tc:TestContacts&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;We also have a Register Assembly line at the top that points to the 1.0.0.0 version of the file.&amp;#160; And we have an entry in our web.config that looks like this:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;runtime&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;assemblyBinding&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;dependentAssembly&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;assemblyIdentity&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Tester1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;publicKeyToken&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;6ace53ab3256c766&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;bindingRedirect&lt;/span&gt; &lt;span class="attr"&gt;oldVersion&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1.0.0.0-1.1.0.0&amp;quot;&lt;/span&gt;
                             &lt;span class="attr"&gt;newVersion&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;2.0.0.0&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;dependentAssembly&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;assemblyBinding&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;runtime&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;We could have done this in a policy file and got the same results.&amp;#160; So now we open this file in Design view inside Visual Studio and change a property of the TestContacts control.&amp;#160; For instance, adding an AccessKey.&amp;#160; Switching back to the Source view, we will now see:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tc:TestContacts&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;QuickContacts1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;samples.aspnet.cs.controls.acontact&lt;/span&gt; Name=&amp;quot;Test Tester&amp;quot; 
        Email=&amp;quot;test@test.com&amp;quot; 
        Phone=&amp;quot;(999) 555-1212&amp;quot; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;samples.aspnet.cs.controls.acontact&lt;/span&gt; Email=&amp;quot;no@spam.thx&amp;quot; 
        Name=&amp;quot;Mr. A. Nonymous&amp;quot; 
        Phone=&amp;quot;(999) 555-1234&amp;quot; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;tc:TestContacts&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;This breaks the site and it no longer works.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: Assembly Binding Redirection works find in other scenarios, it just doesn’t work right inside the Designer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;Resolutions&lt;/h3&gt;

&lt;p&gt;There are two ways to resolve this issue.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Don’t use Assembly Binding Redirection at all and just leave the 1.0.0.0 version of the file in the GAC.&amp;#160; You will see a lot of .NET files do this, there are versions for .NET 1.0, 1.1, 2.0, etc all inside the GAC at the same time. &lt;/li&gt;

  &lt;li&gt;Change the existing files so that the Register Assembly line at the top of the web page points to the 2.0.0.0 version of the file. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep in mind that this is only a problem if you are actively changing the older files already, if you don’t touch the file it will be fine since this issue is only with the Designer.&amp;#160; So since you are already updating the file, it is trivial to update this line also.&lt;/p&gt;

&lt;p&gt;We are looking into this issue also, so there may be another resolution posted in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fblogs.msdn.com%2ftom%2farchive%2f2008%2f04%2f24%2fvisual-studio-designer-not-respecting-assembly-binding-redirection.aspx"&gt;&lt;img border="0" alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblogs.msdn.com%2ftom%2farchive%2f2008%2f04%2f24%2fvisual-studio-designer-not-respecting-assembly-binding-redirection.aspx" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8422491" width="1" height="1"&gt;</description></item></channel></rss>