[Bug 26426] .NET 3.5 Framework installer fails to install some assemblies into GAC (affects Visual Studio 2008 and later products)

wine-bugs at winehq.org wine-bugs at winehq.org
Sun May 13 15:57:18 CDT 2012


http://bugs.winehq.org/show_bug.cgi?id=26426

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |download, Installer
                URL|                            |http://go.microsoft.com/fwl
                   |                            |ink/?LinkId=104679
          Component|-unknown                    |msi
                 CC|                            |focht at gmx.net
     Ever Confirmed|0                           |1
            Summary|Visual Basic 2008 Express   |.NET 3.5 Framework
                   |can't create programs       |installer fails to install
                   |and/or load the tollbox     |some assemblies into GAC
                   |                            |(affects Visual Studio 2008
                   |                            |and later products)

--- Comment #5 from Anastasius Focht <focht at gmx.net> 2012-05-13 15:57:18 CDT ---
Hello,

confirming.
Refining summary as this affects all Visual Studio products that make use of
.NET MSBuild engine 3.5

Visual Studio 2008 requires .NET Framework 3.5 as prerequisite before running
the installer.

--- snip ---
$ bash winetricks -q dotnet35
--- snip ---

>From your terminal output:

--- snip ---
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'Microsoft.Build.Engine, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Exception from
HRESULT: 0x80070002
File name: 'Microsoft.Build.Engine, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'
   at
Microsoft.VisualStudio.Build.ComInteropWrapper.GlobalEngineAccessor.get_GlobalEngine()
   at EnvDTE.SolutionClass.AddFromTemplate(String FileName, String Destination,
String ProjectName, Boolean Exclusive)
   at Microsoft.VisualStudio.TemplateWizard.Wizard.Execute(Object application,
Int32 hwndOwner, Object[]& ContextParams, Object[]& CustomParams, wizardResult&
retval)
--- snip ---

This missing assembly reference has to be fixed.

The MSBuild engine reference assembly is located here:

"C:\\Program Files\\Reference
Assemblies\\Microsoft\\Framework\\v3.5\\Microsoft.Build.Engine.dll"

In GAC we find the .NET 2.0 version of the build engine:

--- snip ---
$ ls -g $(winepath "c:\\windows\\assembly\\GAC_MSIL\\Microsoft.Build.Engine")
total 4
drwxrwxr-x. 2 focht 4096 May 13 19:34 2.0.0.0__b03f5f7f11d50a3a
--- snip ---

Tracing .NET 3.5 Framework installation with right debug channels yields the
cause...

WINEDEBUG=+tid,+seh,+msi,+fusion

--- snip ---
...
0031:trace:msi:load_component Loading Component
L"MSBuildEngine_GAC_v35_x86.3643236F_FC70_11D3_A536_0090278A1BB8" 
...
0031:trace:msi:get_assembly_record component is a global assembly 
...
0031:trace:msi:msi_load_assembly feature L"NetFX_Core_x86_enu_DDF" 
...
0031:trace:msi:msi_load_assembly manifest
L"FL_MSBuildEngine_dll_GAC_v35_x86_ln.3643236F_FC70_11D3_A536_0090278A1BB8"
0031:trace:msi:msi_load_assembly application (null)
0031:trace:msi:msi_load_assembly attributes 0 
...
0031:trace:msi:msi_load_assembly display name
L"Microsoft.Build.Engine,version=\"3.5.0.0\",publicKeyToken=\"b03f5f7f11d50a3a\",processorArchitecture=\"MSIL\",fileVersion=\"3.5.21022.8\",culture=\"neutral\""
0031:trace:fusion:IAssemblyCacheImpl_QueryAssemblyInfo (0xcab730, 0,
L"Microsoft.Build.Engine,version=\"3.5.0.0\",publicKeyToken=\"b03f5f7f11d50a3a\",processorArchitecture=\"MSIL\",fileVersion=\"3.5.21022.8\",culture=\"neutral\"",
0x33b1e4)
0031:trace:fusion:CreateAssemblyNameObject (0x33b198,
L"Microsoft.Build.Engine,version=\"3.5.0.0\",publicKeyToken=\"b03f5f7f11d50a3a\",processorArchitecture=\"MSIL\",fileVersion=\"3.5.21022.8\",culture=\"neutral\"",
00000001, (nil))
0031:trace:fusion:CreateAssemblyEnum (0x33b190, (nil), 0xc12ee0, 00000002,
(nil))
0031:trace:fusion:GetCachePath (00000002, 0x33ace8, 0x33ace4)
0031:trace:fusion:IAssemblyNameImpl_GetName (0xc12ee0, 0x33a1e4, 0x33a1e8)
0031:trace:fusion:IAssemblyNameImpl_GetName (0xc12ee0, 0x33a1e4, 0x33a1e8)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 4, 0x339912,
0x339920)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 5, 0x339910,
0x33991c)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 6, 0x33990e,
0x339918)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 7, 0x33990c,
0x339914)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 1, 0x3398b0,
0x339924)
0031:trace:fusion:CreateAssemblyNameObject (0xcae7e8, L"Microsoft.Build.Engine,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", 00000001,
(nil))
0031:trace:fusion:IAssemblyNameImpl_GetName (0xc12ee0, 0x33a1e4, 0x33a1e8)
0031:trace:fusion:IAssemblyEnumImpl_GetNextAssembly (0xcad190, (nil), 0x33b194,
0)
0031:trace:fusion:IAssemblyNameImpl_AddRef (0xc0f9f0)->(ref before = 1)
0031:trace:fusion:IAssemblyNameImpl_Release (0xc12ee0)->(ref before = 1)
0031:trace:fusion:IAssemblyNameImpl_Release (0xc0f9f0)->(ref before = 2)
0031:trace:fusion:IAssemblyEnumImpl_Release (0xcad190)->(ref before = 1)
0031:trace:fusion:IAssemblyNameImpl_Release (0xc0f9f0)->(ref before = 1)
0031:trace:msi:msi_load_assembly runtime version L"v1.0.3705"
0031:trace:fusion:IAssemblyCacheImpl_QueryAssemblyInfo (0xca1f78, 0,
L"Microsoft.Build.Engine,version=\"3.5.0.0\",publicKeyToken=\"b03f5f7f11d50a3a\",processorArchitecture=\"MSIL\",fileVersion=\"3.5.21022.8\",culture=\"neutral\"",
0x33b1e4)
0031:trace:fusion:CreateAssemblyNameObject (0x33b198,
L"Microsoft.Build.Engine,version=\"3.5.0.0\",publicKeyToken=\"b03f5f7f11d50a3a\",processorArchitecture=\"MSIL\",fileVersion=\"3.5.21022.8\",culture=\"neutral\"",
00000001, (nil))
0031:trace:fusion:CreateAssemblyEnum (0x33b190, (nil), 0xc12ee0, 00000002,
(nil))
0031:trace:fusion:GetCachePath (00000002, 0x33ace8, 0x33ace4)
0031:trace:fusion:IAssemblyNameImpl_GetName (0xc12ee0, 0x33a1e4, 0x33a1e8)
0031:trace:fusion:IAssemblyNameImpl_GetName (0xc12ee0, 0x33a1e4, 0x33a1e8)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 4, 0x339912,
0x339920)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 5, 0x339910,
0x33991c)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 6, 0x33990e,
0x339918)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 7, 0x33990c,
0x339914)
0031:trace:fusion:IAssemblyNameImpl_GetProperty (0xc12ee0, 1, 0x3398b0,
0x339924)
0031:trace:fusion:CreateAssemblyNameObject (0xc0fb70, L"Microsoft.Build.Engine,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", 00000001,
(nil))
0031:trace:fusion:IAssemblyNameImpl_GetName (0xc12ee0, 0x33a1e4, 0x33a1e8)
0031:trace:fusion:IAssemblyEnumImpl_GetNextAssembly (0xcad190, (nil), 0x33b194,
0)
0031:trace:fusion:IAssemblyNameImpl_AddRef (0xc0f9f0)->(ref before = 1)
0031:trace:fusion:IAssemblyNameImpl_Release (0xc12ee0)->(ref before = 1)
0031:trace:fusion:IAssemblyNameImpl_Release (0xc0f9f0)->(ref before = 2)
0031:trace:fusion:IAssemblyEnumImpl_Release (0xcad190)->(ref before = 1)
0031:trace:fusion:IAssemblyNameImpl_Release (0xc0f9f0)->(ref before = 1)
0031:trace:msi:msi_load_assembly runtime version L"v1.1.4322"
0031:trace:msi:is_assembly_installed QueryAssemblyInfo returned 0x80070002
0031:trace:msi:msi_load_assembly assembly is installed
...
0031:Call KERNEL32.GetFileAttributesW(0033cd54
L"C:\\windows\\assembly\\GAC_MSIL\\Microsoft.Build.Engine\\3.5.0.0__b03f5f7f11d50a3a")
ret=79f0d7d5
0031:Ret  KERNEL32.GetFileAttributesW() retval=ffffffff ret=79f0d7d5
...
0031:trace:msi:is_assembly_installed QueryAssemblyInfo returned 0x80070002
0031:trace:msi:msi_load_assembly assembly is installed 
...
0031:trace:msi:calculate_install_state file
L"FL_MSBuildEngine_dll_GAC_v35_x86_ln.3643236F_FC70_11D3_A536_0090278A1BB8" is
not scheduled for install
0031:Call KERNEL32.GetFileAttributesW(01299570 L"C:\\Program Files\\Reference
Assemblies\\Microsoft\\Framework\\v3.5\\Microsoft.Build.Engine.dll")
ret=7d59fad8
0031:Ret  KERNEL32.GetFileAttributesW() retval=ffffffff ret=7d59fad8
0031:trace:msi:calculate_install_state file
L"FL_MSBuildEngine_dll_v35_x86_ln.3643236F_FC70_11D3_A536_0090278A1BB8" is
missing 
--- snip ---

Fusion's IAssemblyCacheImpl_QueryAssemblyInfo() returned the already installed
.NET 2.0 assembly as match two times:

Source:
http://source.winehq.org/git/wine.git/blob/605e0b7b4176bf5e5cf5888073103016e56b8a2f:/dlls/msi/assembly.c#l293

--- snip ---
 293 MSIASSEMBLY *msi_load_assembly( MSIPACKAGE *package, MSICOMPONENT *comp )
 294 {
...
 328     if (a->application)
 329     {
...
 335     }
 336     else
 337     {
 338         if (a->attributes == msidbAssemblyAttributesWin32)
 339             a->installed = is_assembly_installed( package->cache_sxs,
a->display_name );
 340         else
 341         {
 342             UINT i;
 343             for (i = 0; i < CLR_VERSION_MAX; i++)
 344             {
 345                 a->clr_version[i] = is_assembly_installed(
package->cache_net[i], a->display_name );
 346                 if (a->clr_version[i])
 347                 {
 348                     TRACE("runtime version %s\n",
debugstr_w(get_clr_version_str( i )));
 349                     a->installed = TRUE;
 350                 }
 351             }
 352         }
 353     }
 354     TRACE("assembly is %s\n", a->installed ? "installed" : "not
installed");
 355     msiobj_release( &rec->hdr );
 356     return a;
 357 }
--- snip ---

is_assembly_installed -> IAssemblyCache_QueryAssemblyInfo -> fusion's
IAssemblyCacheImpl_QueryAssemblyInfo

Source:
http://source.winehq.org/git/wine.git/blob/93f292506c4fefa126474ad323362e2bc9bfd3d0:/dlls/fusion/asmcache.c#l279

I'm not sure about the rationale of this for-loop is_assembly_installed.
Using the full canonical name of the assembly (with version 3.5.0.0) there
wouldn't be any match.

Because of this mishap, some GAC assemblies that have lower .NET Framework
version companions in GAC are mistakenly assumed installed.

Only the reference assembly gets installed.
This doesn't help because it's a private path, it has to be in GAC for native
image generation to work.

--- snip ---
0031:trace:msi:cabinet_copy_file extracting
L"FL_MSBuildEngine_dll_v35_x86_ln.3643236F_FC70_11D3_A536_0090278A1BB8" ->
L"C:\\Program Files\\Reference
Assemblies\\Microsoft\\Framework\\v3.5\\Microsoft.Build.Engine.dll" 
...
--- snip ---

$ wine --version
wine-1.5.4

Regards

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list