Home Dashboard Directory Help
Search

VS 2010 Custom Action - Error 1001 Unable to get installer type ... by thichcoiphim2


Status: 

Closed
 as By Design Help for as By Design


1
0
Sign in
to vote
Type: Bug
ID: 615378
Opened: 10/20/2010 12:50:25 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

I have upgraded my project from vs2008 sp1 to vs2010 v.10.0.30319.1 RTMRel Ultimate Edition.

I got an error 1001 Unable to get installer type... during running setup if my setup includes a custom action (note: for testing I just include a custom action without any custom code)
The error message I got from Fusion Log Viewer is as shown below.
Based on the error log my application could not load my mixed mode library in .net 4 without additional configuration. So I modify the config as shown in my app config (note: all projects are using .net 4 setting)

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

Now, I can run my application without error in .net 4 but the setup still fail for error 1001.
I have tried to narrow down where the problem is and I found out that
If I just include a variable that references to an enumeration of my mixed mode library then I got error 1001

example code:
Public Class Form1
    Private m_enOperation As Company.MixedModeLib.OperationTypeEnum
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
End Class


OperationTypeEnum is the enumeration in my library and the variable enOperation declared in the member of my form will create the problem.
If I declare the variable enOperation as local then it would not fail during setup.
I really has no clue why the setup of vs2010 fail in this scenario.
My mixed mode library (MC++) developed with .net 1.1 v1.1.4322 sp1 in VS2003 and the installation is performed on Windows XP sp3 (my development pc).
I though after I modified the app config useLegacyV2RuntimeActivationPolicy="true" to allow my application to load my mixed mode library in .net 4 would solve the installation issue but it is not
I also tried to create a new test application in vs2010 .net 4 and incude my mixed mode library and declare a variable as described above and I got the same issue if using custom action in setup

It seems that VS 2010 tries to load my mixed mode library without taking into the app configuration setting during setup if I use custom action.

Is this VS 2010 bug?


I really appreciate for any help.

*** Assembly Binder Log Entry (10/20/2010 @ 11:48:32 AM) ***
The operation failed.
Bind result: hr = 0x80004005. Unspecified error
Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\WINDOWS\system32\MsiExec.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = CompanyNT\Tester

LOG: DisplayName = Company.MixedModeLib, Version=2.1.0.1, Culture=neutral, PublicKeyToken=2d3497331b752ad6

(Fully-specified)

LOG: Appbase = file:///C:/WINDOWS/system32/

LOG: Initial PrivatePath = NULL

LOG: Dynamic Base = NULL

LOG: Cache Base = NULL

LOG: AppName = MsiExec.exe

Calling assembly : TestCustomAction, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

===
LOG: This bind starts in LoadFrom load context.

WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().

LOG: No application configuration file found.

LOG: Using host configuration file: C:\DOCUME~1\Tester~1\LOCALS~1\Temp\CFGC05.tmp

LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.

LOG: Post-policy reference: Company.MixedModeLib, Version=2.1.0.1, Culture=neutral, PublicKeyToken=2d3497331b752ad6

LOG: GAC Lookup was unsuccessful.

LOG: Attempting download of new URL file:///C:/WINDOWS/system32/MixedModeLib.dll.

LOG: Attempting download of new URL file:///C:/WINDOWS/system32/Company.MixedModeLib/MixedModeLib.dll.

LOG: Attempting download of new URL file:///C:/WINDOWS/system32/Company.MixedModeLib.EXE.

LOG: Attempting download of new URL file:///C:/WINDOWS/system32/Company.MixedModeLib/Company.MixedModeLib.EXE.

LOG: Attempting download of new URL file:///C:/Program Files/Company/TestCustomActionSetup/MixedModeLib.dll.

LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\Company\TestCustomActionSetup\MixedModeLib.dll

LOG: Entering run-from-source setup phase.

LOG: Assembly Name is: Company.MixedModeLib, Version=2.1.0.1, Culture=neutral, PublicKeyToken=2d3497331b752ad6

LOG: Where-ref bind Codebase does not match what is found in default context. Keep the result in LoadFrom context.

LOG: Binding succeeds. Returns assembly from C:\Program Files\Company\TestCustomActionSetup\MixedModeLib.dll.

LOG: Assembly is loaded in LoadFrom load context.

ERR: Rejecting IJW module built against v1.1.4322 because it could be loaded into another runtime in this process.

ERR: Rejecting IJW module built against v1.1.4322 because it could be loaded into another runtime in this process.

Details
Sign in to post a comment.
Posted by Microsoft on 8/1/2011 at 2:45 PM
We have spoken with the experts in this matter and this scenario is not supported.

Managed code is not recommended for CAs, and MC++ is bound to a specific runtime. Though we don't recommend it, if you want to use managed CAs please look at DTF – part of WiX – at http://wix.sourceforge.net.
Posted by thichcoiphim2 on 3/17/2011 at 12:56 PM
I believe that since I have the custom action is part of my application which is a mixed mode of .NET Framework 4 and legacy frameworks that causes the Setup fail to run correctly.

In order to run this application I have to include these lines in the app.config
<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
It works when running the application itself.

When I create the installation I try to use he custom action in my application which the Installer tries to load my application without the config lines above therefore it fails.

So the only way I can think of is to create a separate custom action in .NET Framework 4.0 only then it works.

It tooks me a while to figure out that msiexec.exe cannot load my custom action because it is in a mixed mode .net frameworks application.

Is this a solution or just a work around even there is nothing in the custom action routine?

Or basically If your application is a mixed mode of .net Framework 4.0 then you cannot have the custom action to be part of the application itself for installation.

Posted by Microsoft on 3/17/2011 at 10:24 AM
Can you give some more information about what the custom action is that you are including? Is it a managed custom action? The config setting you put in your application doesn't apply for the installer because msiexec.exe is the entrypoint executable and you dont control the configuration for that. Do you know what is causing .NET 4 to be loaded by Windows Installer? Are you installing assemblies into the GAC?
Posted by Microsoft on 10/25/2010 at 1:44 AM
Thank you for attaching the project to help us reproduce this issue. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.These specialized experts will follow-up with your issue.
Posted by thichcoiphim2 on 10/21/2010 at 5:11 AM
Hi,
I have attached a vs2010 sample application that uses MixedModeLib. The application itself can run by itself without problem when it references to .net 1.1 library. However, the setup fails to run if it contains a custom action. Without custom action the setup runs OK.
Posted by thichcoiphim2 on 10/21/2010 at 4:38 AM
Hi,
My intention is to develop my application in vs2010 with .net 4 and the application will need to use library developed in VS2003 with .net Framework 1.1 sp1. So I do not know why we need to convert the library to vs2010 since it defeats the purpose of this feedback.


Thanks
Posted by Microsoft on 10/21/2010 at 1:36 AM
Thank you for reporting this issue.
We upgraded your project "MixedModeLib" to VS2010 and compiled it. There are 8 errors and 102 warnings in the Error List. Could you please attach a correct one that can compile successfully in VS2010?
Posted by Microsoft on 10/20/2010 at 6:35 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
MixedModeLib.rar 10/20/2010 903 KB
TestCustomAction.rar 10/21/2010 62.51 MB