Kinook Software Forums

Go Back   Kinook Software Forums > Visual Build Professional > [VBP] Third Party Tools

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-23-2009, 10:05 AM
jjkboswell jjkboswell is online now
Registered User
 
Join Date: 07-15-2008
Location: Reading, UK
Posts: 9
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
Reply With Quote
  #2  
Old 01-23-2009, 10:17 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,723
http://www.kinook.com/Forum/showthre...?threadid=3465
Reply With Quote
  #3  
Old 01-23-2009, 10:24 AM
jjkboswell jjkboswell is online now
Registered User
 
Join Date: 07-15-2008
Location: Reading, UK
Posts: 9
Quote:
Originally posted by kinook
http://www.kinook.com/Forum/showthre...?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
Reply With Quote
  #4  
Old 01-23-2009, 10:43 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,723
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.
Attached Files
File Type: bld msbuild.bld (504 Bytes, 512 views)
Reply With Quote
  #5  
Old 01-23-2009, 10:46 AM
jjkboswell jjkboswell is online now
Registered User
 
Join Date: 07-15-2008
Location: Reading, UK
Posts: 9
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
Reply With Quote
  #6  
Old 01-23-2009, 10:59 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,723
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 "";
}
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 03:49 AM.


Copyright 1999-2019 Kinook Software, Inc.