<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Chris Flaat's WebLog : VS tips</title><link>http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx</link><description>Tags: VS tips</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Command-line build (devenv /build, MSBuild, etc.)</title><link>http://blogs.msdn.com/cflaat/archive/2004/08/24/219544.aspx</link><pubDate>Tue, 24 Aug 2004 18:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:219544</guid><dc:creator>cflaat</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/219544.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=219544</wfw:commentRss><description>&lt;p&gt;In the comments about a post I made a year ago about devenv /build (&lt;A href="http://blogs.msdn.com/cflaat/archive/2003/08/19/51624.aspx"&gt;here&lt;/a&gt;), a person named Peter just a couple weeks ago made the following comment:&lt;/p&gt; &lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt; &lt;p&gt;&lt;em&gt;When we use IDE to build a project, we have the file(s) checked-out, and IDE will build the changes (checked-out files), will command build do so? I.e. do I need to check in my changes in order to build them? If so, then that's a big drawback for command build. &lt;br /&gt;&lt;br /&gt;Thanks, &lt;br /&gt;Peter &lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p dir="ltr"&gt;Comments on that old post are now closed (maybe because it's a year old?), so I'll answer here.&amp;nbsp; Peter, I'm not sure I fully get your question, but in general we build whatever's on your machine, be it checked out or not.&amp;nbsp; This is true whether it's devenv /build or MSBuild.&lt;/p&gt; &lt;p dir="ltr"&gt;There were a few other complaints about devenv /build putting up UI.&amp;nbsp; When this happens, it's a bug (sorry!).&amp;nbsp; In Whidbey, we will provide MSBuild, which is competely separable from VS and runs without any GUI around (as with NMake, NAnt, etc.).&lt;/p&gt; &lt;p dir="ltr"&gt;Chris&lt;/p&gt; &lt;p dir="ltr"&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=219544" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>MSBuild talk at PDC</title><link>http://blogs.msdn.com/cflaat/archive/2003/10/17/51650.aspx</link><pubDate>Sat, 18 Oct 2003 01:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51650</guid><dc:creator>cflaat</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51650.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51650</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Hi all -
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &amp;#160;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        So, as I mentioned in an &lt;a href="http://blogs.gotdotnet.com/cflaat/PermaLink.aspx/74aef00c-b26d-4982-868d-a9083f70f9eb"&gt;earlier
        blog entry&lt;/a&gt;&lt;?xml:namespace prefix = st1 ns = 
"urn:schemas-microsoft-com:office:smarttags" /&gt;, 
        &lt;st1:PersonName w:st="on"&gt;Alex 
Kipman&lt;/st1:PersonName&gt;
        &amp;amp; 
        &lt;st1:PersonName w:st="on"&gt;Rajeev 
Goel&lt;/st1:PersonName&gt;
        are going to do a &lt;a href="http://mymsevents.com/MyMSEvents/search.aspx?s=1&amp;amp;keywords=msbuild&amp;amp;keywordtype=1&amp;amp;track=0&amp;amp;speaker=0&amp;amp;timeslot=0&amp;amp;future=0"&gt;PDC
        presentation&lt;/a&gt; on MSBuild (the new build engine we’re including with Whidbey).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you’re going to the PDC, be sure to check it out.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;It’s
        Monday, Oct. 27&lt;sup&gt;th&lt;/sup&gt; from 4:45-6pm in one of the big rooms.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I’ve
        seen one of the early versions of their presentation and it’s very cool.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;They
        cover many aspects of MSBuild, including how it integrates with VS, and will have
        lots of technical details and demos.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you’re interested in build issues, check it out!
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51650" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>Introducing MSBuild</title><link>http://blogs.msdn.com/cflaat/archive/2003/09/16/51645.aspx</link><pubDate>Tue, 16 Sep 2003 22:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51645</guid><dc:creator>cflaat</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51645.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51645</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        Hi all -
    &lt;/p&gt;
    &lt;p&gt;
        &amp;#160; More stuff has come online.&amp;#160; See &lt;a href="http://mymsevents.com/MyMSEvents/search.aspx?s=1&amp;amp;keywords=msbuild&amp;amp;keywordtype=1&amp;amp;track=0&amp;amp;speaker=0&amp;amp;timeslot=0&amp;amp;future=0"&gt;here&lt;/a&gt; for
        a little blurb about MSBuild, which is what we're calling our cool new build engine
        that will ship along with Whidbey.
    &lt;/p&gt;
    &lt;p&gt;
        -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51645" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>PDC 2003 tracks announced</title><link>http://blogs.msdn.com/cflaat/archive/2003/09/16/51644.aspx</link><pubDate>Tue, 16 Sep 2003 19:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51644</guid><dc:creator>cflaat</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51644.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51644</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Greetings, all!
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Microsoft has announced the broad outline of the material to be presented at the PDC
        2003.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;See &lt;a href="http://msdn.microsoft.com/events/pdc/tracks.aspx"&gt;here&lt;/a&gt; for
        the list of tracks &amp;amp; presentations.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Under the “Languages and Tools” section you’ll see a cryptic reference to “a new unified
        build system”.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This is one of the really
        cool things we’re working on for Whidbey.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;As
        details get publicized, I’ll keep you all updated.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Until
        more gets announced, however, that’s all I can say.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;(I’m
        not, alas, an authorized PR representative of Microsoft!)
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        The PDC will contain a lot of exciting stuff this year.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I
        probably won’t be able to go myself (due to some scheduling conficts) but plenty of
        people from our team will be there.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;There
        will not only be cool stuff from VS, but also some great stuff from Longhorn (the
        next version of Windows).
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        That’s all for now! -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51644" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>More on configurations</title><link>http://blogs.msdn.com/cflaat/archive/2003/09/05/51638.aspx</link><pubDate>Fri, 05 Sep 2003 19:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51638</guid><dc:creator>cflaat</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51638.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51638</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Greetings, all!&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;In my &lt;a href="http://blogs.gotdotnet.com/cflaat/PermaLink.aspx/6b09828a-59a5-4ad4-9951-d7e4257ef4c6"&gt;entry
        about devenv /build&lt;/a&gt;, a reader named Toby mentions the pain of maintaining multiple
        configurations when you have a lot of them that are identical except for one flag.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;He
        says:
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in"&gt;
        &lt;span class="commentbody"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;In my work, I'll deal with
        several types of configurations: release, debug, profile build, unicode/mbcs, managed/unmanaged,
        xbox/pc, inline assembly/unoptimized C, etc. Some of these are truly unique configurations,
        requiring differing compiler options, etc. However, some are really just toggling
        a flag (unicode/mbcs for example). Each of these toggled flags requires twice the
        number of configurations. And when one of the configurations changes, all of the variants
        need to be changed.&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;
        &lt;o:p&gt;&lt;/o:p&gt;
        &lt;/span&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        I’m sorry that this is a less than pleasant experience, Toby.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I
        don’t know of any way to do this any better than the workarounds you mentioned, at
        least for VS 2002 / 2003.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;What you really
        want is a way to define a solution configuration that sets a few variables and then
        passes those into project configurations that are otherwise shared.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        I can say that we are doing some things in the next version of VS (known as Whidbey)
        that should make this significantly less painful, especially in the command-line build
        scenario, although you may have to do a little low-level project file tweaking.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;We’re
        announcing some Whidbey features related to this area at the PDC in late October,
        so interested people should stay tuned (and I’ll be commenting on these new Whidbey
        features here in my blog).
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Toby also asks why this evolved the way it did.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I’ve
        been working in the solution/project area for only about a year &amp;amp; a half now,
        so I don’t have lots of insight into the historical evolution of this feature.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;But
        I would guess that most users are not doing the multi-axis customization of builds
        that Toby is, so this scenario was never really optimized for.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;But
        being able to richly handle this kind of scenario, unconstrained by any particular
        assumptions of the IDE, is definitely the direction we are moving in for Whidbey &amp;amp;
        beyond.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        That’s all for now! -Chris
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51638" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>Building from the command line: devenv /build</title><link>http://blogs.msdn.com/cflaat/archive/2003/08/19/51624.aspx</link><pubDate>Tue, 19 Aug 2003 19:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51624</guid><dc:creator>cflaat</dc:creator><slash:comments>23</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51624.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51624</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Greetings, dear readers!&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Today I want
        to talk about using devenv.exe to build a solution or project from the command line
        (as opposed to interactively inside the IDE).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;For
        example, you can say “devenv /build debug myapp.sln” to do a debug build of myapp.sln.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Now,
        I have to admit that if there was one feature I could deny any association with, it
        would be this one.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;There are many things
        about this feature that are harder to understand and use than they should be.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;(In
        my defense I can say that this feature took its current form before I took over this
        area!)&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Rest assured, however, that we’re
        working to make some improvements in this space for Whidbey.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        A number of users don’t even know this feature exists.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;But
        it’s very handy.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If you want to build
        a solution or project from a build script then this lets you do it.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Just
        type “devenv /?” from the command line to see what you can do.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;You
        can also see the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxgrfcommandlineswitches.asp"&gt;documentation
        page&lt;/a&gt; for a full list of supported switches.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I’m
        going to focus on the /build switch, but much of what I’m going to say also applies
        to /clean, /rebuild, and /deploy.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;And
        I’m using VS 2003 but most of these comments should also apply to VS 2002.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        A key to understanding this feature is to understand the relationship between solution
        configurations &amp;amp; project configurations.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;See
        my &lt;a href="http://blogs.gotdotnet.com/cflaat/PermaLink.aspx/1440cd94-f292-4726-a6ae-db5623b7fb9b"&gt;blog
        entry from 8/14/03&lt;/a&gt; for more on that.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        The most basic operation with devenv /build is to build a whole solution configuration.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This
        is pretty easy.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If you have a solution
        called myapp.sln, and it has a configuration called “Debug” (which it normally would
        by default), then you can build it by typing “devenv /build debug myapp.sln”.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This
        should give you the same result as if you opened up the IDE, picked that solution
        configuration, and did Build.Build Solution.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;(Note
        that you can only build one solution, and one solution configuration, at a time.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you need to build more than one, use a batch file to wrap your calls to devenv.exe.)
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Another thing you can do is operate on one project at a time.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you have myapp.sln that contains proj1.vcproj and proj2.vcproj, you might only want
        to build one project at a time, without having to define a separate solution configuration.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you want to do this, understand that you still have to specify a solution configuration
        to give the build proper context.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This
        is because some things, like project-to-project references, need a solution configuration
        context in which to be resolved properly.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Therefore
        the syntax to build just proj1.vcproj in the solution’s debug configuration would
        be:
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in"&gt;
        devenv /build debug /project proj1 myapp.sln
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        This basically says: “Build the debug configuration of myapp.sln, and only include
        the project proj1 in the build.”
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        When using the /project switch to specify a specific project to build, you can only
        specify one project at a time.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If you
        pass the /project switch multiple times, the last one wins &amp;amp; the prior /project
        switches are ignored.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If you want to
        build a certain set of more than one project, you should define a separate solution
        configuration.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Another thing you can do when building just one project is specify a particular project
        configuration to be built.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Let’s say
        I wanted to build just proj1.vcproj again, but this time with the release configuration
        – and just for fun, using the debug configuration of the solution!&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I
        can do it like this:
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;span style="mso-tab-count: 1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;devenv
        /build debug /project proj1 /projectconfig “release|.net” myapp.sln
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        The switch we’ve added is /projectconfig, followed by the value of “release|.net”.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;Why
        the funny syntax with “|” instead of just “release”?&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;The
        trick here is that the configuration of a project includes not only things like debug/release,
        but also the platform you’re targeting.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Ordinarily,
        VB &amp;amp; C# project target the platform “.NET” and VC++ targets the platform “Win32”
        (even for managed C++, which is confusing).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;But
        if you buy, say, a version of VC++ that targets Win64, that’s another platform choice.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;So,
        just remember than when using the /projectconfig switch you need to add “|” followed
        by the platform the project targets (which you can see in the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxurfconfigurationmanagerdialogboxs.asp"&gt;Configuration
        Manager dialog&lt;/a&gt; under Build.Configuration Manager).
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        We hope to make many aspects of “devenv /build” a little easier to use in the next
        major release, but hopefully this information will make this feature less mystifying
        for the next time you want to use it.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        That’s all for now! -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51624" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>Solution configurations &amp; project configurations</title><link>http://blogs.msdn.com/cflaat/archive/2003/08/14/51621.aspx</link><pubDate>Thu, 14 Aug 2003 21:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51621</guid><dc:creator>cflaat</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51621.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51621</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Greetings, dear readers!&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Today I want
        to talk about solution configurations and project configurations.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;These
        are important concepts that are essential to understand if you’re trying to do complex
        coordination of builds using VS, esp. if you're using the DTE or devenv /build at
        the command line.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;However, this is a
        tricky subject which even a lot of people within the Developer Division don’t fully
        understand.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Also be sure to see the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxconbuildconfigurations.asp"&gt;documentation
        page&lt;/a&gt; for project &amp;amp; solution configurations
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Let’s start with projects.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Projects can
        have an arbitrary set of configurations.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Think
        of a configuration as a knob that tells Visual Studio &lt;i style="mso-bidi-font-style: normal"&gt;how&lt;/i&gt; to
        build a project.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;The classic configurations
        are “Debug” and “Release”.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;For most users,
        there is no need to go beyond these.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;However,
        you might want to define your own project configuration if you want additional ways
        to build your project (say, with additional diagnostics built in) that don’t exactly
        map to what you want in a debug build or in your final release build.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        You can create (or delete) project configurations in a dialog called the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxurfconfigurationmanagerdialogboxs.asp"&gt;Configuration
        Manager&lt;/a&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;You can reach this via Build.Configuration
        Manager menu item.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;To add a new project
        configuration, find row for the project and find the “Configuration” column.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Click
        on the dropdown and click on “&amp;lt;New…&amp;gt;” (this dialog will never win any usability
        awards).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This lets you create a new project
        configuration.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;You specify three pieces
        of information.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;First, the name.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Second,
        you can optionally specify another configuration to copy settings from (for example,
        if you’re making a configuration that’s just like your Debug configuration but only
        differs in a few settings, pick Debug to copy from).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Third,
        you can create a solution configuration that corresponds to it (more about that later).
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Understand that a project configuration is a parallel bucket of settings.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you create a new project configuration that copies from the Debug project configuration,
        you are doing a copy, but any changes you make later to the Debug project configuration
        won’t be reflected in your copy.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;(The
        same principle applies to solution configurations.)
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Now, what’s a solution configuration?&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Think
        of a solution configuration as a bucket of arbitrary project configurations.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Solution
        configurations don’t have to have the same name as project configurations.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;A
        solution configuration is essentially a list of all your projects where you pick which
        projects should be included and which configurations should be built.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Let’s try an example.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Create a new C#
        Windows Application project.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Now click
        on Build.Configuration Manager again to return to the Configuration Manager dialog.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;What
        you are looking at is the list of projects and configurations for the solution’s “Debug”
        configuration.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;There is only one project
        in the list.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;The configuration for this
        project that we’re building is “Debug”, and the platform is “.NET”.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;The
        “Build” checkbox is checked.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        If you uncheck the “Build” checkbox, it means that the “Debug” solution configuration
        shouldn’t build your C# winapp project.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;So
        when you do Build.Build Solution, nothing will be built.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This
        is useless for a single-project solution, but can be useful if you have a lot of projects
        and there are scenarios where you only want to build a few.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;In
        that case you can create a new solution configuration to do this.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        How do you create a new solution configuration?&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;At
        the top of the Configuration Manager dialog there’s a dropdown with a list of solution
        configurations.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Click this dropdown and
        pick “&amp;lt;New…&amp;gt;”.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Then you can create
        a new solution configuration.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;It’s just
        like creating a new project configuration except that instead of being asked if you
        want to create a new solution configuration, you’re now asked if you want to create
        new project configurations to mirror the new solution configuration.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;(To
        get rid of either a solution or project configuration, click on &amp;lt;Edit…&amp;gt; in the
        appropriate dropdown.)
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Let’s go back to the Configuration Manager dialog for the C# winapp we created.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;We’ve
        discussed the “Build” checkbox, but what about the Configuration and Platform columns?&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;These
        are very important.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;The two of these
        put together make a true project configuration.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;For
        example, if you have Debug and .NET selected, your project configuration is “Debug|.NET”.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This
        is a very important point.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;When you reference
        a project configuration via the DTE or via the command line (devenv /build), you need
        to refer to project configurations using the combined form.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Note
        that the platform can be different, e.g. in VC++ if you are targeting Win64.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;You
        can then have Debug|Win32 and Debug|Win64, and these represent totally different project
        configurations.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        If you’re back at the Configuration Manager dialog with our little C# app, you should
        see the “Debug” solution configuration selected in the dropdown at the top.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        I go down to my project and go to the “Configuration” row, the dropdown says “Debug”.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Just
        for fun, change it to “Release”.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If you
        hit OK, then every time you build the “Debug” solution configuration, you’ll be building
        the “Release” configuration of your project!&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This
        is kind of a silly example, but a practical application would be if you want to enable
        a special diagnostic build (e.g. heavy assertions) in one of your projects but not
        others.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;For a given solution configuration,
        you can pick arbitrary configurations for your projects.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        In different parts of the VS IDE, you will sometimes interact with solution configurations
        and sometimes with project configurations.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;On
        the main IDE toolbar, there’s a dropdown that controls your active solution configuration.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This
        is what solution configuration gets build if you do Build.Build Solution.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Project configurations come into play when editing project settings.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;For
        example, if you right-click on a project in the solution explorer &amp;amp; bring up the
        project’s properties (or if you just pick Project.Properties in the main menu) you’ll
        see a property sheet with the project configuration settings (expressed via its two
        halves, the basic configuration plus the platform).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Once
        again, I want to remind you that when referring to a project configuration via DTE
        or devenv /build, you need to refer to the whole thing, e.g. “Debug|.NET” or “Release|Win32”.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        One other note.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;You might be wondering
        if you can have a solution configuration with multiple instances of the same project.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;You
        cannot.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;However, you can approximate
        this using the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxurfbatchbuilddialogboxs.asp"&gt;Batch
        Build&lt;/a&gt; dialog (Build.Batch Build in the main menu), which I might cover in a future
        blog entry.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        That’s all for now! -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51621" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>Sneak peek at Whidbey</title><link>http://blogs.msdn.com/cflaat/archive/2003/07/30/51617.aspx</link><pubDate>Wed, 30 Jul 2003 19:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51617</guid><dc:creator>cflaat</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51617.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51617</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        There's a &lt;a href="http://www.internetnews.com/dev-news/article.php/2241651"&gt;news
        report&lt;/a&gt; about what MSFT disclosed at the VS Live! event.&amp;#160; See the link for
        info about some of the cool things we're doing in Whidbey (the next major release
        of VS) and Orcas (the release after that).&amp;#160; Whidbey is what most of the VS teams
        are spending most of their time on.
    &lt;/p&gt;
    &lt;p&gt;
        Now, some of the &lt;em&gt;really&lt;/em&gt; cool things we're doing in Whidbey are still not
        disclosed, but probably will be in the fall.&amp;#160; When they are, rest assured that
        I'll keep you all in the loop!
    &lt;/p&gt;
    &lt;p&gt;
        Later! -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51617" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>New VSIP program rollout</title><link>http://blogs.msdn.com/cflaat/archive/2003/07/29/51613.aspx</link><pubDate>Tue, 29 Jul 2003 20:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51613</guid><dc:creator>cflaat</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51613.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51613</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        There's now free registration&amp;#160;at the &lt;a href="http://www.vsipdev.com"&gt;VSIP&amp;#160;site&lt;/a&gt;&amp;#160;to
        become a VSIP ("Visual Studio Industy Partner"), which is the program whereby you
        can write a low-level package that integrates more deeply into Visual Studio than
        is possible as an add-in (or macro).&amp;#160; The VSIP program is great for 3rd party
        companies that want to sell add-ons for Visual Studio.&amp;#160; But anyone can participate,
        including hobbyists who just want to play around or add that one special feature they
        think would be handy.&amp;#160; -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51613" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>Watson addendum</title><link>http://blogs.msdn.com/cflaat/archive/2003/07/24/51610.aspx</link><pubDate>Thu, 24 Jul 2003 23:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51610</guid><dc:creator>cflaat</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51610.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51610</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        A reader named Martin makes a good point made about my earlier weblog entry about
        Watson crashes; he&amp;#160;says we could offer a way to let users provide more information
        when a bug is difficult to reproduce.&amp;#160; Actually, we already do this in cases
        where we're having difficulty making progress, I just forgot to mention that.&amp;#160;
        Thanks for bringing this up Martin. -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51610" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>Watson's revenge</title><link>http://blogs.msdn.com/cflaat/archive/2003/07/24/51598.aspx</link><pubDate>Thu, 24 Jul 2003 19:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51598</guid><dc:creator>cflaat</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51598.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51598</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        My dear readers, I have a terrible admission to make.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;But
        it's time to come clean with you.&amp;#160; The fact is, of our hundreds of thousands
        of users, a small number encounter crashing bugs in Visual Studio.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;They
        are working happily along, and *boom* some terrible crash will occur.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Then,
        a much-dreaded dialog will come up, saying:
    &lt;/p&gt;
    &lt;p&gt;
        &lt;b style="mso-bidi-font-weight: normal"&gt;“Microsoft Development Environment has encountered
        a problem and needs to close.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;&lt;?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /&gt;We
        are sorry for the inconvenience.”&lt;o:p&gt;&lt;/o:p&gt;
        &lt;/b&gt;
    &lt;/p&gt;
    &lt;p&gt;
        And then a little farther down it says…&lt;o:p&gt;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p&gt;
        &lt;b style="mso-bidi-font-weight: normal"&gt;“Please tell Microsoft about this problem.&lt;o:p&gt;&lt;/o:p&gt;
        &lt;/b&gt;
    &lt;/p&gt;
    &lt;p&gt;
        &lt;b style="mso-bidi-font-weight: normal"&gt;We have created an error report that you can
        send to help us improve Microsoft Development Environment.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;We
        will treat this report as confidential and anonymous.&lt;o:p&gt;&lt;/o:p&gt;
        &lt;/b&gt;
    &lt;/p&gt;
    &lt;p&gt;
        &lt;b style="mso-bidi-font-weight: normal"&gt;To see what data this error report contains, &lt;u&gt;click
        here&lt;/u&gt;.”&lt;o:p&gt;&lt;/o:p&gt;
        &lt;/b&gt;
    &lt;/p&gt;
    &lt;p&gt;
        Then you see three buttons: Debug, Send Error Report, and Don’t Send.
    &lt;/p&gt;
    &lt;p&gt;
        [It occurs to me that the lack of the word “The” in front of “Microsoft Development
        Environment” above makes it look like English is our second language.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I’ll
        have to bug somebody about that…]
    &lt;/p&gt;
    &lt;p&gt;
        Obviously, in a perfect world users would never see this dialog.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;It
        means that our users had VS crash, possibly losing data. &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;During
        product development we treat any bug that could make VS crash or otherwise lose data
        as extremely serious, and few such bugs make it into the shipping product.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;But
        it does, alas, happen.
    &lt;/p&gt;
    &lt;p&gt;
        So, what does this dialog do, and what does it all mean?&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;We
        call this the “Watson” dialog (not to be confused with the &lt;a href="http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/windowsxp/home/using/productdoc/en/drwatson_overview.asp"&gt;Dr.
        Watson&lt;/a&gt; tool, which is related but different).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;The
        dialog exists so that when a user hits a crash, if they choose to hit the “Send Error
        Report” button then a condensed stack dump, which we call a &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/minidump_files.asp"&gt;minidump&lt;/a&gt;,
        gets sent to a server at Microsoft.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you’re curious or paranoid, click where it says “click here” and you can see exactly
        what’s going to be sent to our server.
    &lt;/p&gt;
    &lt;p&gt;
        Once that happens, you can hopefully go on with your work.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;On
        our side, however, the work is just beginning.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;We
        have people who go through the reported crash dumps and then open bugs in the main
        product bug databases so that our developers can look at the minidumps and try to
        figure out why the product crashed.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This
        is an extremely unpleasant job, because the information in the minidump is so scant,
        and sometimes we can’t piece together the cause of the crash.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Often,
        however, we can figure out what went from the callstack and make a fix.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        a lot of people are hitting a crash in an already-shipped product then we consider
        rolling the fix into a service pack.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        the report is against a version under development (e.g. an alpha or beta release),
        or if a very tiny number of people are hitting a crash in an already-shipped versoin,
        we generally roll the fix into the version under development.
    &lt;/p&gt;
    &lt;p&gt;
        There is, of course, a certain amount of “cosmic justice” in making VS developers
        suffer through the investigation of these Watson reports, since the pain of having
        the product crash from under you is much worse.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;And
        it’s a great motivation to code carefully so as to avoid code paths that could lead
        to crashes.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;(Which we do already through
        many mechanisms, but I figure every extra drop of motivation is a good thing.)
    &lt;/p&gt;
    &lt;p&gt;
        If you are ever unfortunate enough to see this dialog, please accept my apologies
        in advance.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;But if it does every happen,
        I hope you now understand what it means and I hope you will hit the “Send Error Report”
        button so that we at Microsoft can get your crash report and investigate it.
    &lt;/p&gt;
    &lt;p&gt;
        That’s all for now! -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51598" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>More thoughts on handling untrusted solutions/projects</title><link>http://blogs.msdn.com/cflaat/archive/2003/07/21/51597.aspx</link><pubDate>Mon, 21 Jul 2003 22:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51597</guid><dc:creator>cflaat</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51597.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51597</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        A reader named Uri commented on my July 15th entry about safe handling of untrusted
        solutions &amp;amp; projects.&amp;#160; He brings up some good points which I thought worth
        addressing.
    &lt;/p&gt;
    &lt;p&gt;
        One thing he mentions is that often one needs to grab a whole sample project at a
        time and can't just grab snippests here &amp;amp; there.&amp;#160; True enough, Uri, that's
        sometimes the case.&amp;#160; When it's most effective to grab a whole project, just be
        sure that the source is someone you trust.
    &lt;/p&gt;
    &lt;p&gt;
        Another question Uri raises is whether one might be able to quarantine untrusted code
        by putting it on another share to make it be in a less-trusted zone.&amp;#160; This is
        a great point, and there are indeed some things that are a bit safer when done in
        this way.&amp;#160; However, there are still many potential ways to get fried, and unfortunately
        putting an untrusted solution/project on another share still doesn't really make it
        safe to use.
    &lt;/p&gt;
    &lt;p&gt;
        Some things to note if you were to try loading a solution/project from another share:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;
            On loading, the IDE will give you ominous warnings that things may not work correctly.&lt;/li&gt;
        &lt;li&gt;
            Custom build steps in C# projects, a new feature in VS 2003,&amp;#160;generally won't
            work, at least not that I found.&amp;#160; In a sense this is good, because it means rogue
            build steps wouldn't run, but it's also bad because any legitimate build step won't
            happen either.&lt;/li&gt;
        &lt;li&gt;
            Despite the fact that C# custom build steps won't run, an evil project can still toast
            you in other subtle ways as part of the build process.&lt;/li&gt;
    &lt;/ul&gt;
    &lt;p&gt;
        In general, using a project from an intranet share won't protect you from mailicious
        solutions/projects, and will furthermore interfere with legitimate ones, so I don't
        really recommend this approach.
    &lt;/p&gt;
    &lt;p&gt;
        That's all for now! -Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51597" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>Don't take code (or solutions or projects) from strangers</title><link>http://blogs.msdn.com/cflaat/archive/2003/07/15/51593.aspx</link><pubDate>Wed, 16 Jul 2003 02:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51593</guid><dc:creator>cflaat</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51593.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51593</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Greetings, my dear readers.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I wanted
        to offer some&amp;#160;suggestions about how VS users can safely handle code obtained
        from other sources.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;A combination of
        common sense and careful reading of the VS documentation would lead you to the same
        conclusions I’m laying out here, but I thought it might be helpful to summarize these
        tips in one place.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Now, most of you hopefully know that if you get a program from someone else via e-mail
        or on some other medium, it is extremely unwise to actually run that program unless
        you really understand what it is.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        it turns out to be a malicious program, then any manner of terrible things might happen:
        you might lose all your data, your data might be sent to someone else, virus-carrying
        e-mails might get sent to your friends &amp;amp; associates, etc.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;And
        nasty programs can be transmitted via other files besides .exe’s: batch files, word
        processing documents, spreadsheets, etc.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        What about Visual Studio solutions and projects?&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;My
        guidance to you is simple: &lt;b style="mso-bidi-font-weight: normal"&gt;Do not open, build,
        or run solutions or projects from untrusted sources.&lt;/b&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;They
        could be malicious and could be every bit as dangerous as running a malicious executable.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Treat
        them with the same care you’d give an untrusted .exe.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I’ll
        discuss ways to mitigate this such that you can try to work with code from an untrusted
        solution or project without getting burned, but understand that this course of action
        is inherently risky.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If in doubt, don’t
        even &lt;b style="mso-bidi-font-weight: normal"&gt;open&lt;/b&gt; a solution or project from an
        untrusted source, and for heaven’s sake don’t build or run it.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Now, perhaps I’ve scared some of my dear readers with the above statements.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;But
        none of this should be too surprising if you think about what a solution or project
        is.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;A solution or project expresses how
        to build a program (which itself could be malicious).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;So
        you not only have a potentially evil program, you have a bunch of other associated
        operations that help to design &amp;amp; build that program, which themselves could be
        evil.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Note that at an abstract level,
        it’s not really any different than if you downloaded a .cpp file and a makefile –
        if the makefile erases your hard drive instead of compiling the code, it doesn’t really
        mean NMake.exe is inherently bad; it means you were foolish to invoke a makefile from
        an untrusted source.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Makefiles are inherently
        powerful; so is VS.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        If you &lt;b style="mso-bidi-font-weight: normal"&gt;do&lt;/b&gt; want to be able to grab code
        from other sources, then read on and I’ll offer some tips so that you can better understand
        how to manage the inherent risks of doing so.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        One note about VS 2002 and VS 2003.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you’re still using VS 2002, consider upgrading to VS 2003.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This
        isn’t some sales pitch I’m making in order to boost the stock price.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;VS
        2003 has a lot of small improvements, including security-related ones, that make it
        a valuable upgrade from VS 2002.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;However,
        the advice I’m giving here still generally applies if you use VS 2002.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Now, I had originally wanted to describe this stuff starting with the simple cases
        and then working up to the complex ones.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;However,
        the most complex case, the issues with opening a solution or project, are the first
        thing one is likely to run into, so I’m going to tackle that first.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Why is it potentially dangerous to simply open an untrusted VS solution?&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Well,
        if you’ve read the VS documentation carefully (e.g. &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxtskcreatingreferencestofilesinsolutionexplorer.asp"&gt;this
        page&lt;/a&gt;), you might have noted some ominous warnings about how opening up the VS.NET
        forms designer can run code in your project, and therefore you need to ensure that
        the code is trustworthy before opening it in the designer.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I’ll
        not go into the deep, dark details of this (after all, I don’t want to make it any
        easier for people to do harmful things), but suffice it to say that a project can
        be constructed such that merely opening up a form can cause (potentially evil) code
        in the project to be executed.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        In VS 2002 this could be very dangerous because if you opened up a solution we would
        also look at your .suo file, which has a list of what files to open up when the solution
        is opened.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;So…if you created an evil
        solution that would run evil code when the designer is used on a form, and your .suo
        indicated that the form should be opened when the solution loads, simply opening up
        the solution file would cause the evil code to be run.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;In
        VS 2003 this is mitigated to some extent; in VS 2003 we don’t automatically open any
        files listed in the .suo unless the .suo was created on your machine.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Therefore
        if you’re using VS 2002 and you decide to ignore my advice about opening untrusted
        solutions/projects (please don’t!), you would definitely want to delete anyone else’s
        .suo file before proceeding.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        However, even with that change in VS 2003, opening up an untrusted solution is still
        dangerous.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If you open the forms designer
        on an evil file, you’re toast.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Plus,
        if you then build or run the solution, you’re potentially toast as well, as we’ll
        discuss shortly.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This is why I’m giving
        the general recommendation to avoid opening untrusted solutions / projects in VS --
        it’s just so easy to get into trouble, even if you’ve managed to safely open it.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Let’s talk about running &amp;amp; building an untrusted solution or project.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Taking
        an untrusted solution/project and running it (e.g. by hitting F5) is extremely foolish.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;It’s
        basically the same thing as taking an untrusted .exe and running it.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;True,
        you can see the source code, but it’s not hard to do evil things with innocent-looking
        source code.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Even stepping into the program
        with the debugger (e.g. hitting F11) may not be safe, since obscure initialization
        code might get run before the entrypoint that you’ll be stepping into.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Building an untrusted solution or project is likewise hazardous.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;It’s
        easy to insert nastiness into the build process (running an .exe in a custom build
        step is one way, and there are many others).
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        The best thing to do is only take code from sources that you can reasonably trust,
        like from resources inside your organization, people you personally know, from companies
        or authors that you trust, etc.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        If you wish to use code from a source you do not fully trust, the best thing to do
        is take little snippets that do exactly what you want and which you can fully understand.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;For
        example, if you want to learn about drawing graphics with DirectX, create your own
        program and try to find snippets to do exactly what you want (e.g. drawing a circle
        on the screen).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;This is much safer than
        grabbing some huge sample program from a random place on the web where you can’t be
        sure of who wrote it or whether they are trustworthy.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        If you want to grab some big, complex project or solution from an untrusted place
        on the web, stop and assess your sanity.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you believe that you are on the correct side of the sanity line, you are an expert
        on the language &amp;amp; API’s the code is written with, and you understand that you
        are taking a huge and rather foolish risk, then here’s my advice as to how to defend
        against disaster:
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .75in"&gt;
        &lt;span style="mso-list: Ignore"&gt;1)&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;Take
        only the code files (the .cpp files, .cs files, .vb files, etc.).&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Do
        not take the .sln, .suo, .*proj, etc. files.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Likewise,
        do not take makefiles, NAnt files, batch files, etc. as these can also be malicious.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .75in"&gt;
        &lt;span style="mso-list: Ignore"&gt;2)&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;Open
        each code file in isolation and read every line.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Do
        not open it in the VS forms designer.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;Instead,
        use the Open With feature of VS (detailed in one of my earlier blog entries) to view
        it with the VS source code editor or just use Notepad.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .75in"&gt;
        &lt;span style="mso-list: Ignore"&gt;3)&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;Inspect
        every line.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If you see anything that
        either looks dangerous or which you don’t understand, don’t go any further until you
        figure out what it does and why.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;You
        are on your own, and responsible for the consequences of not fully understanding the
        code.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .75in"&gt;
        &lt;span style="mso-list: Ignore"&gt;4)&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;Create
        your own VS solution &amp;amp; project (don’t use the one that came with it).
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .75in"&gt;
        &lt;span style="mso-list: Ignore"&gt;5)&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;Add
        the files that you’ve inspected &amp;amp; that you believe are safe to your newly created
        project.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.75in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1; tab-stops: list .75in"&gt;
        &lt;span style="mso-list: Ignore"&gt;6)&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;Take
        a deep breath and do some soul searching as to whether you really want to go any further:
        at this point opening files in the designer or running the program will lead to disaster
        if you missed something in step #3.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        One thing I also want to make clear is that most of these issues apply to any code
        and any development environment.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If you
        obtain makefiles, batch files, perl scripts, awk scripts, etc. from an untrusted source,
        they are potentially dangerous if you run them.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        I hope this information is useful, and I hope I’ve made it clear that untrusted solutions,
        projects, and code need to be handled with the utmost care.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I’d
        love to hear any comments that readers have on this topic.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If
        you have comments, please add a blog comment.
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &lt;o:p&gt;&amp;#160;&lt;/o:p&gt;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        Bye for now! –Chris
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        &amp;#160;
    &lt;/p&gt;
    &lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;
        [Please note: This weblog entry is provided "AS IS" with no warranties, and confers
        no rights.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; Opening&amp;#160;and/or u&lt;/span&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" 
/&gt;sing
        solutions or projects from untrusted sources is inherently dangerous and the author, 
        &lt;st1:PersonName&gt;Chris Flaat&lt;/st1:PersonName&gt;
        , does not recommend it.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;If you attempt
        to open and/or use a solution or project from an untrusted source, then you do so
        at your own risk.]
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51593" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>Linked items and SCC integration</title><link>http://blogs.msdn.com/cflaat/archive/2003/07/11/51587.aspx</link><pubDate>Sat, 12 Jul 2003 02:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51587</guid><dc:creator>cflaat</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51587.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51587</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        A person named Blair commented on one of my prior entries about using linked files.&amp;#160;
        They mention that the integration of a project's linked files with source code control
        has some limitations, esp. when you link to files outside the current project directory.
    &lt;/p&gt;
    &lt;p&gt;
        I looked into this issue a bit, and I can state that this claim is, well, uh, shall
        we say...not entirely inaccurate.&amp;#160; :-)&amp;#160; However, it's not quite as bleak
        as one might think.&amp;#160; I talked with some people who understand this particular
        issue a lot better than me, and here’s a summary of what they told me.
    &lt;/p&gt;
    &lt;p&gt;
        In VS 2002 and VS 2003, when a project with linked items is added to source code control,
        VS goes through and calculates the closest common parent to all the files in the project,
        and that becomes the root of the project in VSS (we call it the “unified root”).&amp;#160;
        If later you try and link a new file, AND it’s under the existing unified root, it
        will be added to SCC.&amp;#160;&amp;#160;(If it's not under the unified root, it will still
        be added as a linked&amp;#160;file but won't be added to SCC.)&lt;br /&gt;
        &amp;#160;&lt;br /&gt;
        For example, let’s say you have a VB project in c:\My Visual Studio Projects\foo and
        you've added c:\boot.ini as a linked item.&amp;#160; If you then add that project to SCC,
        your unified root will map to c:\.&amp;#160; If you then add another file from somewhere
        under c:\ as a linked item then it should still get successfully added to SCC.&amp;#160;
        (However, if you try to add a linked file from another drive, e.g. under d:\, you
        can add it as a linked file but it can’t be added to SCC.&amp;#160; That’s just a limitation
        of the current SCC integration.)&amp;#160; The most important thing to understand is that
        when you do the first “Add to Source Control” operation, your initial unified root
        is set up.
    &lt;/p&gt;
    &lt;p&gt;
        If for some reason you really need a linked item from another drive, you could work
        around this by adding to your solution a new project that lives on the other drive,
        add the linked item to that project, and then add your whole solution (e.g. with one
        project on c: and one project on the d: drive) to SCC.&lt;br /&gt;
        &amp;#160;&lt;br /&gt;
        Bottom line: Where possible, the best thing to do is figure out ahead of time what
        linked files (and other projects) you need, and add them to your project before adding
        the whole project to SCC.&amp;#160; Obviously, you can’t always know that up front, but
        when possible this is the way to go.
    &lt;/p&gt;
    &lt;p&gt;
        If you already have a project under SCC and you really want to add an SCC-controlled
        linked item to it from somewhere outside your unified root, you could try to work
        around this by changing the unified root, but this is complex, risky (you could lose
        change history), and not really recommended unless you’re a really advanced VSS user.&lt;br /&gt;
        A (somewhat lame) workaround is simply to avoid using SCC with linked files.&amp;#160;
        Put the file under the same directory as your other files, and you’re done.&amp;#160;
        If this is feasible, this is clearly the path of least resistance.
    &lt;/p&gt;
    &lt;p&gt;
        Personally, I use linked files only when I want to occasionally view a file that isn’t
        really “part of” my project, but still get syntax coloring, symbol browsing features,
        etc.&lt;br /&gt;
        So, I hope this provides some useful information about how this stuff works, and suggests
        some ways to make linked files coexist better with source code control.&amp;#160; If you
        want to read more about linked items, &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxconfolder-basedreference-basedprojects.asp"&gt;this
        MSDN page&lt;/a&gt; is a good place to start.
    &lt;/p&gt;
    &lt;p&gt;
        Have a good weekend! -Chris&lt;br /&gt;
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51587" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item><item><title>Saving files with different encodings &amp; line endings</title><link>http://blogs.msdn.com/cflaat/archive/2003/07/11/51586.aspx</link><pubDate>Fri, 11 Jul 2003 21:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:51586</guid><dc:creator>cflaat</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cflaat/comments/51586.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cflaat/commentrss.aspx?PostID=51586</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        Now, this feature could be described as more of a text editor feature than a project
        feature, and it's not owned by my team, but it's relevant &amp;amp; useful enough that
        I think it's worth mentioning here.
    &lt;/p&gt;
    &lt;p&gt;
        With VS you can save a text file with an arbitrary language encoding (ANSI, Shift-JIS,
        Unicode, UTF-8, etc.) and arbitrary line endings (CR/LF, CR only, etc.).
    &lt;/p&gt;
    &lt;p&gt;
        If you're using VS 2003 (I think these&amp;#160;steps are&amp;#160;identical for VS 2002),
        then open up any scratch text file (e.g. .vb, .cs, .cpp, .txt, whatever).&amp;#160; Then
        go to the File menu and pick Save &amp;lt;file&amp;gt; As (or hit alt-F followed by A) to
        bring up the Save As dialog.
    &lt;/p&gt;
    &lt;p&gt;
        As with some of the prior tips I've mentioned, the magic lies in the obscure little
        down-arrow at the right edge of the "Save" button.&amp;#160; Click on this little down-arrow
        and click "Save with encoding".&amp;#160; If you didn't change the filename you'll asked
        to confirm that you want to overwrite the current file -- just say "yes", assuming
        this isn't a critical file that you didn't want to churn; otherwise choose a different
        filename and you won't get that confirmation msgbox.
    &lt;/p&gt;
    &lt;p&gt;
        You will then reach the "Advanced Save Options" dialog.&amp;#160; You can now tweak the
        save operation to change your encoding or your line endings.
    &lt;/p&gt;
    &lt;p&gt;
        Line endings are a simpler issue so let's start there.&amp;#160; The dropdown lists four
        options.&amp;#160; "Current Setting" means "leave your line endings alone".&amp;#160; The
        other three are self-explanatory, giving you a choice between CR/LR, CR, and LR as
        your newline sequence.&amp;#160; These are useful if you want to share out your files
        with someone on a Mac(TM) or Unix(TM) system.
    &lt;/p&gt;
    &lt;p&gt;
        Encoding is a thornier issue, and in the dropdown you will see a vast number of choices.&amp;#160;
        The first thing I will say is that if you don't know what you're doing, don't change
        your encoding on important files because you could permanently lose data.
    &lt;/p&gt;
    &lt;p&gt;
        If you do know what you're doing, here you will find lots of&amp;#160;useful encodings
        for your file.&amp;#160; Lots of MBCS encodings, many Unicode variants (UTF-16, UTF-8,
        UTF-7, variants for big-endian, no signature, etc.), and lots of OEM and other encodings
        whose subtleties I don't claim to really understand.&amp;#160; Changing your encoding
        lets you store international characters that you might not otherwise be able to store
        in your file, but be careful not to switch to an encoding that the tools &amp;amp; editors
        you want to use with the file can't understand.&amp;#160; Also understand that if you
        have characters in&amp;#160;an encoding like Unicode, you could potentially lose data
        if you save to another encoding which cannot express all the same characters.&amp;#160;
        Be very careful because if you are randomly changing encodings you could lose data.
    &lt;/p&gt;
    &lt;p&gt;
        A fairly useful page on MSDN about language encoding issues is &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxtsksavingfileswithencoding.asp"&gt;here&lt;/a&gt;.&amp;#160;
        This page has several useful links at the bottom if you want to learn more.
    &lt;/p&gt;
    &lt;p&gt;
        That's all for now.&amp;#160;-Chris
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=51586" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cflaat/archive/tags/VS+tips/default.aspx">VS tips</category></item></channel></rss>