View Full Version : Make VS is using VS2005 not 2008
jjkboswell
01-23-2009, 11:05 AM
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
kinook
01-23-2009, 11:17 AM
http://www.kinook.com/Forum/showthread.php?threadid=3465
jjkboswell
01-23-2009, 11:24 AM
Originally posted by kinook
http://www.kinook.com/Forum/showthread.php?threadid=3465
Ok, I'll be clearer, on the machine that works is VS2008 installed, on the machine that doesn't work (i.e. uses VS2005) I have both VS2008 and VS2005. So your statement:
"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
kinook
01-23-2009, 11:43 AM
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/showthread.php?threadid=3044 along with the build output of the attached project. Thanks.
jjkboswell
01-23-2009, 11:46 AM
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
kinook
01-23-2009, 11:59 AM
This is approximately how VBP 6.2a located msbuild (the logic has changed quite a bit since then):
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 "";
}
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.