Assembly Loading Failure

O

Olivier Matrot

Hello,
I have a .NET application that is called from within an installer custom
action.
The custom action is written in c# and called from a web site setup project.
The application is installed in the web site's bin directory.
It depends on libraries that are installed in the GAC.

The call to the application in the custom action is done through
Process.Start (not using shell execute).
Here is the fusion log :
________________________________________________

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'FaxBoxCustomer, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=cb1c7cff7286f087' or one of its dependencies. Le fichier
sp,cifi, est introuvable.
File name: 'FaxBoxCustomer, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=cb1c7cff7286f087'
at RTEFAXExpressCustomer.Program.Main(String[] args)

=== Pre-bind state information ===
LOG: User = RTENETWORK\olivier.matrot
LOG: DisplayName = FaxBoxCustomer, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=cb1c7cff7286f087
(Fully-specified)
LOG: Appbase = file:///C:/inetpub/wwwroot/NAWEB3/bin/
LOG: Initial PrivatePath = NULL
Calling assembly : RTEFAXExpressCustomer, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=cb1c7cff7286f087.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file:
C:\inetpub\wwwroot\NAWEB3\bin\RTEFAXExpressCustomer.exe.config
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: FaxBoxCustomer, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=cb1c7cff7286f087
LOG: Attempting download of new URL
file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer.DLL.
LOG: Attempting download of new URL
file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer/FaxBoxCustomer.DLL.
LOG: Attempting download of new URL
file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer.EXE.
LOG: Attempting download of new URL
file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer/FaxBoxCustomer.EXE.
___________________________________________________

The problem is that 'FaxBoxCustomer' library is located in the GAC, and
that the application is working fine when launched from the command line !
In both case the user is the same.

Previously the libraries were located alongside the application.

TIA.
 
V

Vadym Stetsiak

Hello, Olivier!

Are there any assemblyBinding elements in the
RTEFAXExpressCustomer.exe.config?

Consult the following article
http://msdn2.microsoft.com/en-us/library/yx7xezcf.aspx, particularly the
section about
"steps to resolve an assembly reference".

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Tue, 11 Sep 2007 17:29:23 +0200:

OM> Hello,
OM> I have a .NET application that is called from within an installer
OM> custom action.
OM> The custom action is written in c# and called from a web site setup
OM> project.
OM> The application is installed in the web site's bin directory.
OM> It depends on libraries that are installed in the GAC.

OM> The call to the application in the custom action is done through
OM> Process.Start (not using shell execute).
OM> Here is the fusion log :
OM> ________________________________________________

OM> Unhandled Exception: System.IO.FileNotFoundException: Could not load
OM> file or assembly 'FaxBoxCustomer, Version=1.0.0.0, Culture=neutral,
OM> PublicKeyToken=cb1c7cff7286f087' or one of its dependencies. Le
OM> fichier sp,cifi, est introuvable.
OM> File name: 'FaxBoxCustomer, Version=1.0.0.0, Culture=neutral,
OM> PublicKeyToken=cb1c7cff7286f087'
OM> at RTEFAXExpressCustomer.Program.Main(String[] args)

OM> === Pre-bind state information ===
OM> LOG: User = RTENETWORK\olivier.matrot
OM> LOG: DisplayName = FaxBoxCustomer, Version=1.0.0.0, Culture=neutral,
OM> PublicKeyToken=cb1c7cff7286f087 (Fully-specified)
OM> LOG: Appbase = file:///C:/inetpub/wwwroot/NAWEB3/bin/
OM> LOG: Initial PrivatePath = NULL
OM> Calling assembly : RTEFAXExpressCustomer, Version=1.0.0.0,
OM> Culture=neutral,
OM> PublicKeyToken=cb1c7cff7286f087.
OM> ===
OM> LOG: This bind starts in default load context.
OM> LOG: Using application configuration file:
OM> C:\inetpub\wwwroot\NAWEB3\bin\RTEFAXExpressCustomer.exe.config
OM> LOG: Using machine configuration file from
OM> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
OM> LOG: Post-policy reference: FaxBoxCustomer, Version=1.0.0.0,
OM> Culture=neutral, PublicKeyToken=cb1c7cff7286f087
OM> LOG: Attempting download of new URL
OM> file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer.DLL.
OM> LOG: Attempting download of new URL
OM> file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer/FaxBoxCustomer.
OM> DLL.
OM> LOG: Attempting download of new URL
OM> file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer.EXE.
OM> LOG: Attempting download of new URL
OM> file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer/FaxBoxCustomer.
OM> EXE.
OM> ___________________________________________________

OM> The problem is that 'FaxBoxCustomer' library is located in the GAC,
OM> and that the application is working fine when launched from the
OM> command line !
OM> In both case the user is the same.

OM> Previously the libraries were located alongside the application.

OM> TIA.
 
P

Phil Wilson

Assemblies aren't commited to the GAC during an MSI install until after your
custom actions run, so if you run code that has a dependency on a GAC custom
action it will fail to load it.
 
G

Guest

Thanks for that.

Phil Wilson said:
Assemblies aren't commited to the GAC during an MSI install until after your
custom actions run, so if you run code that has a dependency on a GAC custom
action it will fail to load it.

--
Phil Wilson
[MVP Windows Installer]

Olivier Matrot said:
Hello,
I have a .NET application that is called from within an installer custom
action.
The custom action is written in c# and called from a web site setup
project.
The application is installed in the web site's bin directory.
It depends on libraries that are installed in the GAC.

The call to the application in the custom action is done through
Process.Start (not using shell execute).
Here is the fusion log :
________________________________________________

Unhandled Exception: System.IO.FileNotFoundException: Could not load file
or assembly 'FaxBoxCustomer, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=cb1c7cff7286f087' or one of its dependencies. Le fichier
sp,cifi, est introuvable.
File name: 'FaxBoxCustomer, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=cb1c7cff7286f087'
at RTEFAXExpressCustomer.Program.Main(String[] args)

=== Pre-bind state information ===
LOG: User = RTENETWORK\olivier.matrot
LOG: DisplayName = FaxBoxCustomer, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=cb1c7cff7286f087
(Fully-specified)
LOG: Appbase = file:///C:/inetpub/wwwroot/NAWEB3/bin/
LOG: Initial PrivatePath = NULL
Calling assembly : RTEFAXExpressCustomer, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=cb1c7cff7286f087.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file:
C:\inetpub\wwwroot\NAWEB3\bin\RTEFAXExpressCustomer.exe.config
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: FaxBoxCustomer, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=cb1c7cff7286f087
LOG: Attempting download of new URL
file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer.DLL.
LOG: Attempting download of new URL
file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer/FaxBoxCustomer.DLL.
LOG: Attempting download of new URL
file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer.EXE.
LOG: Attempting download of new URL
file:///C:/inetpub/wwwroot/NAWEB3/bin/FaxBoxCustomer/FaxBoxCustomer.EXE.
___________________________________________________

The problem is that 'FaxBoxCustomer' library is located in the GAC, and
that the application is working fine when launched from the command line !
In both case the user is the same.

Previously the libraries were located alongside the application.

TIA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top