c# - mscoree.dll's GetRequestedRuntimeInfo() causing improper TargetFrameworkDirectories - how to debug? -


i'm having problem .net build system looking in wrong folders framework references. machine has .net 4.0 , visual studio 2010 installed, , problem happens on projects .net version less 4.0 (my example in .net 3.5). problem looked build issues, digging deeper it, found microsoft.build.tasks.v4.0.dll (called during build process) calling mscoree.dll , getting wrong information back:

(decompiled source) frameworklocationhelper. constructdotnetframeworkpathfromruntimeinfo(string requestedversion):

        int num1 = 264;         int num2 = 25;         stringbuilder pdirectory;         stringbuilder pversion;         uint requestedruntimeinfo;                 {             pdirectory = new stringbuilder(num1);             pversion = new stringbuilder(num2);             uint dwdirectorylength;             uint dwlength; -------->   requestedruntimeinfo = nativemethodsshared.getrequestedruntimeinfo(string.empty, requestedversion, string.empty, 16u, 64u, pdirectory, num1, out dwdirectorylength, pversion, num2, out dwlength);             num1 *= 2;             num2 *= 2;         }         while ((int)requestedruntimeinfo == -2147024774);         if ((int)requestedruntimeinfo == 0)             return path.combine(((object)pdirectory).tostring(), ((object)pversion).tostring()); 

the problem call nativemethodsshared.getrequestedruntimeinfo(...), on other machines returns version of .net being requested (3.5, 3.0, , 2.0) on problem machine returns 4.0 each time, resulting in reference paths referencing .net 4.0 (which shouldn't happen in .net 3.5 build). unfortunately, call mscoree.dll, , don't know how debug or find source code:

[dllimport("mscoree.dll", charset = charset.unicode, setlasterror = true)] public static extern uint getrequestedruntimeinfo(string pexe, string pwszversion, string pconfigurationfile, uint startupflags, uint runtimeinfoflags, stringbuilder pdirectory, int dwdirectory, out uint dwdirectorylength, stringbuilder pversion, int cchbuffer, out uint dwlength); 

for reference, other working machines have these framework directories:

targetframeworkdirectories: c:\program files (x86)\reference assemblies\microsoft\framework\v3.5\, c:\windows\microsoft.net\framework\v3.5\, c:\program files (x86)\reference assemblies\microsoft\framework\v3.0\, c:\windows\microsoft.net\framework\v3.0\, c:\windows\microsoft.net\framework\v2.0.50727\

while problem machine has these framework directories:

targetframeworkdirectories: c:\program files (x86)\reference assemblies\microsoft\framework\v3.5\, c:\windows\microsoft.net\framework\v4.0.30319\, c:\program files (x86)\reference assemblies\microsoft\framework\v3.0\, c:\windows\microsoft.net\framework\v4.0.30319\, c:\windows\microsoft.net\framework\v4.0.30319\

also, i've uninstalled , re-installed .net 2.0, 3.0, 3.5, 4.0, , visual studio 2010

mscoree.dll not oracle. use sysinternals' procmon utility find out machine's registry toasted. best compare trace against machine that's okay narrow down.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -