|
#1
|
|||
|
|||
Make VS is using VS2005 not 2008
Hi,
I'm running VB6 Pro 6.2a and on one machine a Make VS step in my build script uses VS2008 correctly, and on another machine the same script incorrectly uses VS2005. If I explicitly set the patch in the override for the build step, it works fine, but I shouldn't have to do that. How does VB6 Pro 6.2a determine which VS version to use? Which macros does it use? As far as I can see, all my global macros are referencing Visual Studio 9.0 folders. James |
#2
|
|||
|
|||
#3
|
|||
|
|||
Quote:
"Prior to VBP v6.7, the Make VS.NET / 2005 / 2008 actions used the latest version of MSBuild.exe that was found. With VBP 6.7 and later, they use the version that matches the project or solution file being built (2.0 for VS 2005, 3.5 for VS 2008) if available." doesn't help me because it is obviously not finding the "latest version of MSBuild.exe". I still need to know "How does VB6 Pro 6.2a determine which VS version to use?", i.e. which macros/environment variables does it use to find VS? James |
#4
|
|||
|
|||
It doesn't use macros or environment variables -- it locates the latest version of the .NET Framework containing MSBuild.exe (via some registry and directory lookups). I'm not sure why it's not finding it on one of your machines. You might try updating to VBP 6.7a or 7.0. If you update to v7 and the problem persists, submit the support information requested here http://www.kinook.com/Forum/showthre...?threadid=3044 along with the build output of the attached project. Thanks.
|
#5
|
|||
|
|||
Updating is not an option at the moment.
I'll have to hard code the paths. It would be helpful if you let me know the registry paths it looks in. James |
#6
|
|||
|
|||
This is approximately how VBP 6.2a located msbuild (the logic has changed quite a bit since then):
Code:
string frameworkPath = GetDotNetFrameworkPath(); if (frameworkPath.Length > 0) { string exe = Path.Combine(frameworkPath, "msbuild.exe"); if (File.Exists(exe)) return exe; } private static string GetDotNetFrameworkPath() { RegistryKey k = Registry.ClassesRoot.OpenSubKey(@"CLSID\{43CD41AD-3B78-3531-9031-3059E0AA64EB}\InprocServer32"); if (k != null) { string ver = ""; double largest = 0.5; foreach (string subkey in k.GetSubKeyNames()) { RegistryKey s = k.OpenSubKey(subkey); if (s != null) { object o = s.GetValue("RuntimeVersion"); if (o != null) { double f = double.Parse(((string)o).Substring(1, 3)); if (f > largest) { largest = f; ver = (string)o; } } } } if (ver.Length > 0) { RegistryKey n = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\.NETFramework"); if (n != null) { object o = n.GetValue("InstallRoot"); if (o != null) return Path.Combine((string)o, ver); } } } return ""; } |
|
|