<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Visual Studio .NET</title><link>http://blogs.clearscreen.com/ragc/category/20.aspx</link><description>Tips and Tricks over this development environment</description><managingEditor>Raúl Alarcón García-Cuevas</managingEditor><dc:language>es-ES</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>Visual Studio 2005, Wrong comparing strings with Assert.AreEquals</title><link>http://blogs.clearscreen.com/ragc/archive/2005/08/25/2394.aspx</link><pubDate>Thu, 25 Aug 2005 09:49:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2005/08/25/2394.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/2394.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2005/08/25/2394.aspx#Feedback</comments><slash:comments>59</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/2394.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/2394.aspx</trackback:ping><description>I'm using Visual Studio 2005 Beta 2 developing an application. In the Unit Testing Features, when you use Assert.AreEquals to compare strings, if they aren't equal, the method stop the test (that's correct) but doesn't exists any place where you can see at which character differs the strings... The equivalent method in NUnit shows you where the strings differs, I'm very wrong with this issue, I can't understand how have been able to forget this aid.&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/2394.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml">I'm using Visual Studio 2005 Beta 2 developing an application. In the Unit Testing Features, when you use Assert.AreEquals to compare strings, if they aren't equal, the method stop the test (that's correct) but doesn't exists any place where you can see at which character differs the strings... The equivalent method in NUnit shows you where the strings differs, I'm very wrong with this issue, I can't understand how have been able to forget this aid.<img src ="http://blogs.clearscreen.com/ragc/aggbug/2394.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>Visual Studio 2003 very slow starting</title><link>http://blogs.clearscreen.com/ragc/archive/2005/04/26/1415.aspx</link><pubDate>Tue, 26 Apr 2005 11:22:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2005/04/26/1415.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/1415.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2005/04/26/1415.aspx#Feedback</comments><slash:comments>22</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/1415.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/1415.aspx</trackback:ping><description>&lt;p&gt;Lately, I become experimenting a long delay when Visual Studio starts. The Projects MRU list is the guilty. When you have a web project pointing to somewhere in a remote machine, Visual Studio tries to get some information from that machine. I have found information about this issue searching through google at this blog: &lt;a href="http://dotnetjunkies.com/WebLog/alexchang/archive/2004/05/04/12730.aspx"&gt;http://dotnetjunkies.com/WebLog/alexchang/archive/2004/05/04/12730.aspx&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;I resolve this issue cleaning the MRU lists in the registry, concretely the removing all entries for the "ProjectMRUList" and "FileMRUList" keys (searching everywhere), but to work fine, you need to do that with Visual Studio closed.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/1415.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Lately, I become experimenting a long delay when Visual Studio starts. The Projects MRU list is the guilty. When you have a web project pointing to somewhere in a remote machine, Visual Studio tries to get some information from that machine. I have found information about this issue searching through google at this blog: <a href="http://dotnetjunkies.com/WebLog/alexchang/archive/2004/05/04/12730.aspx">http://dotnetjunkies.com/WebLog/alexchang/archive/2004/05/04/12730.aspx</a> </p>
<p>I resolve this issue cleaning the MRU lists in the registry, concretely the removing all entries for the "ProjectMRUList" and "FileMRUList" keys (searching everywhere), but to work fine, you need to do that with Visual Studio closed.</p><img src ="http://blogs.clearscreen.com/ragc/aggbug/1415.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>.NET Exception Handling</title><link>http://blogs.clearscreen.com/ragc/archive/2005/02/23/1083.aspx</link><pubDate>Wed, 23 Feb 2005 10:14:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2005/02/23/1083.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/1083.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2005/02/23/1083.aspx#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/1083.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/1083.aspx</trackback:ping><description>&lt;p&gt;&lt;a href="http://www.codeproject.com/dotnet/exceptionbestpractices.asp" target="_blank"&gt;Here&lt;/a&gt; is an article, from "The Code Project" factory, about best practices for exception handling in .NET. The article covers all aspects about this matter, sometimes risky when we are writing code. Everybody knows that exception handling is one of the &lt;span&gt;mechanism provided by high level languages with which coders must deal daily, in my opinion, only the forty percent of the wrote code is related with the logic of the problem, the other sixty percent is wrote to control errors and exceptions, this is the importance of exception handling!.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Enjoy the article!&lt;/span&gt;&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/1083.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://www.codeproject.com/dotnet/exceptionbestpractices.asp" target="_blank">Here</a> is an article, from "The Code Project" factory, about best practices for exception handling in .NET. The article covers all aspects about this matter, sometimes risky when we are writing code. Everybody knows that exception handling is one of the <span>mechanism provided by high level languages with which coders must deal daily, in my opinion, only the forty percent of the wrote code is related with the logic of the problem, the other sixty percent is wrote to control errors and exceptions, this is the importance of exception handling!.</span></p>
<p><span>Enjoy the article!</span></p><img src ="http://blogs.clearscreen.com/ragc/aggbug/1083.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>ASP.NET Error: The server tag is not well formed</title><link>http://blogs.clearscreen.com/ragc/archive/2004/10/28/525.aspx</link><pubDate>Thu, 28 Oct 2004 15:21:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2004/10/28/525.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/525.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2004/10/28/525.aspx#Feedback</comments><slash:comments>69</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/525.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/525.aspx</trackback:ping><description>&lt;P&gt;This is the error that I get if try to view an aspx page with any server control that uses the DataBinder.Eval function, like the following&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&amp;lt;asp:Button id=but Text="Button" runat="server"&amp;nbsp; &lt;STRONG&gt;CommandArgument="&amp;lt;%# DataBinder.Eval(Container.DataItem, ("ColIndex")) %&amp;gt;"&lt;/STRONG&gt;&amp;gt; &amp;lt;/asp:Button&amp;gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The problem is that the ASP.NET parser does not allows nested double quotes. The solution is very easy, use single quotes for the HTML property instead of double quotes:&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN-GB style="mso-ansi-language: EN-GB"&gt;&amp;lt;asp:Button id=but Text="Button" runat="server"&amp;nbsp; CommandArgument=&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;'&lt;/FONT&gt;&lt;/STRONG&gt;&amp;lt;%# DataBinder.Eval(Container.DataItem, ("ColIndex")) %&amp;gt;&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;'&lt;/FONT&gt;&lt;/STRONG&gt;&amp;gt;&amp;lt;/asp:Button&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The most probably is&amp;nbsp;the problem raises before you are trying to view the page in the browser, when you want to switch between the HTML view and the Design view in the Visual Studio editor, the development environment show a message with the following text:&lt;/P&gt;
&lt;P&gt;---------------------------&lt;BR&gt;Microsoft Development Environment&lt;BR&gt;---------------------------&lt;BR&gt;Could not open in Design view. Quote values differently inside a '&lt;% ..."value"... %&gt;' block.&lt;BR&gt;---------------------------&lt;BR&gt;&lt;BR&gt;I think that the message doesn't help you too much to identify the problem...&lt;/P&gt;&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/525.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>A "must-have" tool for Visual Studio .NET</title><link>http://blogs.clearscreen.com/ragc/archive/2004/08/08/390.aspx</link><pubDate>Sun, 08 Aug 2004 12:23:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2004/08/08/390.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/390.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2004/08/08/390.aspx#Feedback</comments><slash:comments>14</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/390.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/390.aspx</trackback:ping><description>&lt;P&gt;Recently, I have discovered a very usefully tool for developers. This tool is fully integrated with Visual Studio .NET, is simple to use and gives to the developer a powerfully way to minimize the spent time with recurrent coding tasks like write properties for classes only specifying the type and the name for the property... &lt;/P&gt;
&lt;P&gt;The tool is based on templates to define recurrent parts of code that the developers must write (properties, try / catch blocks, methods...). After you have defined a template for some coding work, you invoke it directly while you are coding, by example:&lt;/P&gt;
&lt;P dir=ltr&gt;We have defined a template to write properties, in the template you must specify the type for the property and the name. The template is invoked with the following command from the code editor:&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;EM&gt;string Name p&lt;/EM&gt;&lt;CTRL+ENTER&gt;&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;Then, press ctrl+enter and this command is transformed in the following code snippet:&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;EM&gt;private string _name;&lt;BR&gt;public string Name&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _name; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&amp;nbsp;{ _name = value; }&lt;BR&gt;}&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Autocode&lt;/STRONG&gt; is the name of that tool and you can download it (for free) from &lt;A href="http://www.devprojects.net" target=_blank&gt;www.devprojects.net&lt;/A&gt;.&amp;nbsp;&amp;nbsp;The web&amp;nbsp;have a lot of&amp;nbsp;templates for code substitution that you can download, as well as, documentation to make your own templates.&lt;/P&gt;
&lt;P&gt;Enjoy it!&lt;/P&gt;&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/390.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Raúl Alarcón García-Cuevas</dc:creator><title>Embedding Files into Assemblies</title><link>http://blogs.clearscreen.com/ragc/archive/2004/06/09/316.aspx</link><pubDate>Wed, 09 Jun 2004 11:46:00 GMT</pubDate><guid>http://blogs.clearscreen.com/ragc/archive/2004/06/09/316.aspx</guid><wfw:comment>http://blogs.clearscreen.com/ragc/comments/316.aspx</wfw:comment><comments>http://blogs.clearscreen.com/ragc/archive/2004/06/09/316.aspx#Feedback</comments><slash:comments>18</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/ragc/comments/commentRss/316.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/ragc/services/trackbacks/316.aspx</trackback:ping><description>&lt;P&gt;With Visual Studio .NET 2003,&amp;nbsp;we can specify the "&lt;STRONG&gt;Build Action&lt;/STRONG&gt;" property of any file in the solution. This feature bring us the opportunity to embed the content of any file into the result assembly (assemblies) after compilation. It is so simple and can help us when we need&amp;nbsp;some constant data&amp;nbsp;to&amp;nbsp;be deployed with our solution, by example, our application uses an XML schema that (after the application is completed) never changes, and we doesn't like to deploy a separate file with the schema content. Here is a step by step procedure to embed a file into the solution:&lt;BR&gt;1. In the &lt;EM&gt;Solution Explorer&lt;/EM&gt;, right click over the project where we want to have the embedded file, Add / Add Existing Item.&lt;BR&gt;2. Select the file to embed.&lt;BR&gt;3. Show the &lt;EM&gt;Property&lt;/EM&gt; window of the file, and in the property "Build Action", &amp;nbsp;select "Embedded Resource"&lt;/P&gt;
&lt;P&gt;After that, when we compile the solution, we have the content of that file into the assembly, but... how we can read this data? Well, here is a method to extract the content of any embedded resource from the assembly using reflection and stream readers:&lt;/P&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Reflection;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;using&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.IO;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt; getEmbeddedResourceContent(&lt;FONT color=#0000ff&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;resourceFileName)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Assembly myAsembly = Assembly.GetExecutingAssembly();&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string&lt;/FONT&gt;&lt;FONT size=2&gt; resName = String.Empty;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;FONT size=2&gt; resourceName &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;in&lt;/FONT&gt;&lt;FONT size=2&gt; myAsembly.GetManifestResourceNames())&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (resourceName.IndexOf(resourceFileName)&amp;gt;=0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resName = resourceName;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break&lt;/FONT&gt;&lt;FONT size=2&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/FONT&gt;&lt;FONT size=2&gt; (resName.&lt;FONT size=2&gt;Length &lt;/FONT&gt;&amp;gt; 0&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT size=2&gt;Stream s = myAsembly.GetManifestResourceStream(resName);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StreamReader sr = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; StreamReader(s, System.Text.Encoding.GetEncoding(1252));&amp;nbsp;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/FONT&gt;&lt;FONT size=2&gt; sr.ReadToEnd();&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff&gt;else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; Exception("The resource can't be found");&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;Note that this method only works with text files and that we can use other assemblies distinct of the executing assembly to host the embedded resources.&lt;/P&gt;&lt;img src ="http://blogs.clearscreen.com/ragc/aggbug/316.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>