Re: Visual Studio 2008 released



"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message news:MPG.21adf202f460efb462a@xxxxxxxxxxxxxxxxxxxxxxx
Willy Denoyette [MVP] <willy.denoyette@xxxxxxxxxx> wrote:
> Hmm... changing ToolsVersion to 2.0 doesn't stop it from compiling on
> my box. However, adding a <LangVersion>ISO-2</LangVersion> does. I'm
> intrigued as to what ToolsVersion really does...

I didn't say it stops it from compiling, it forces VS2008 to use C# V2 of
the compiler instead of V3.5.

But presumably that should stop it from compiling C# 3 code, which is
what I meant - sorry.

All "ToolsVersion" does is tell VS2008 to load the CSC.EXE from the V2
Framework directory.

Mmm... doesn't seem to be doing anything on my machine :(

Unless that's interacting with the difference between MSBuildToolsPath
and MSBuildBinPath...

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Jon,
Here's the output of a rebuild of a VS2008 solution containing two projects:
1. is a VS2008 project (wftaT1) targeting V3.5
2. is a VS2005 project (volsvs) added to the VS2008 solution.
In project 2, I changed ToolsVersion= "3.5" into "2.0", so now the first line of .csproj looks like this:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"; ToolsVersion="2.0">
------ Rebuild All started: Project: wfaT1, Configuration: Debug x86 ------

C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /platform:x86 /errorreport:prompt /define:DEBUG;TRACE /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /out:obj\x86\Debug\wfaT1.exe /resource:obj\x86\Debug\wfaT1.Form1.resources /resource:obj\x86\Debug\wfaT1.Properties.Resources.resources /target:winexe /win32manifest:app.manifest Form1.cs Form1.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs

Compile complete -- 0 errors, 0 warnings

wfaT1 -> E:\Develop\VS2008Proj\wfaT1\wfaT1\bin\x86\Debug\wfaT1.exe

------ Rebuild All started: Project: volsvs, Configuration: Debug Any CPU ------

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /optimize- /out:obj\Debug\volsvs.exe /target:exe Program.cs Properties\AssemblyInfo.cs

Compile complete -- 0 errors, 0 warnings

volsvs -> E:\Develop\vs2005proj\volsvs\volsvs\bin\Debug\volsvs.exe

========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========



See, the project (1) is build using csc.exe V3.5 (C# 3), while for (2), csc.exe is V2.

The great thing here is that you can mix project versions, you can change project settings from within the VS2008 IDE, the "ToolsVersion" will not be touched.
Things to keep in mind when setting the ToolsVersion="2.0", are:
- the project file does not become a true VS2008 project file, it remains an imported project file, and
- CSC V2 does/can not add a manifest to the resulting exe (for exe targets), this is a problem when targeting Vista and W2K8. You should never run manifest-less applications on Vista and up, so, here you'll have to add a manifest by running mt.exe after each build.

Willy.



.



Relevant Pages

  • Re: Big integer arithmetic
    ... your mac gcc doesn't compile with Integer declared, ... Dijkstra said of PL/I, a mistake, carried through to perfection). ... > test GNU MP programs using XCode. ... > project file, and if I create a dummy project file it can't find all the ...
    (comp.programming)
  • Re: Big integer arithmetic
    ... your mac gcc doesn't compile with Integer declared, ... Dijkstra said of PL/I, a mistake, carried through to perfection). ... > test GNU MP programs using XCode. ... > project file, and if I create a dummy project file it can't find all the ...
    (sci.crypt)
  • Re: Website set as application?
    ... Then, I'd look in the previous project's VS.NET project file, ... I'd compile the new version in VS.NET 2003. ... >> version of the .Net Framework you've got installed. ... the assembly versioning in machine.config is different ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Big integer arithmetic
    ... >also runs the risk that I simply won't do it as well as those already ... Now, being a UNIX/gcc novice, I can't compile any of the ... >project file, and if I create a dummy project file it can't find all the ... The Ultimate Truth is that there is no Ultimate Truth ...
    (comp.programming)
  • Re: Big integer arithmetic
    ... >also runs the risk that I simply won't do it as well as those already ... Now, being a UNIX/gcc novice, I can't compile any of the ... >project file, and if I create a dummy project file it can't find all the ... The Ultimate Truth is that there is no Ultimate Truth ...
    (sci.crypt)