By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,084 Members | 1,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,084 IT Pros & Developers. It's quick & easy.

Loading assembly from AppDomain not working anymore

P: n/a
I have a .NET 2.0 application divided in two assemblies; the exe and a dll.

The application generates a plugin-dll which is then loaded in a separate
AppDomain (along with a second instance of my application dll).

It's been working for months and now the it's not working from my
application exe anymore but still working from NUnit when testing the dll.

What could have changed in my exe? Some configuration thing in my VS2005
project?

The Fusion log from the failing load-attempt is dumped below and thereafter
a successful load from NUnit.

Notice the "Where-ref bind" in the failing attempt; C:\*** !!! - why is it
trying to load from there and not in the two directories setup in the
AppDomain?

Cheers,
Jan
****** FAILING LOAD ******

*** Assembly Binder Log Entry (08-02-2007 @ 16:37:48) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msco rwks.dll
Running under executable
D:\User\repos\MyApplication\trunk\Bin\SZStudio.vsh ost.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = SHIPMATE\JAJ
LOG: Where-ref bind. Location = C:\MyApplicationCore.dll
LOG: Appbase = file:///D:/User/repos/MyApplication/trunk/Bin
LOG: Initial PrivatePath = D:\User\repos\MyApplication\trunk\Bin\Runtime\
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyApplicationCore Runtime
Calling assembly : (Unknown).
===
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 machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\conf ig\machine.config.
LOG: Attempting download of new URL file:///C:/MyApplicationCore.dll.
LOG: All probing URLs attempted and failed.
****** WORKING - FROM NUnit ******

*** Assembly Binder Log Entry (08-02-2007 @ 16:57:00) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msco rwks.dll
Running under executable C:\Program Files\NUnit-Net-2.0
2.2.8\bin\nunit-gui.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = SHIPMATE\JAJ
LOG: Where-ref bind. Location =
D:\User\repos\MyApplication\trunk\Bin\MyApplicatio nCore.dll
LOG: Appbase = file:///D:/User/repos/MyApplication/trunk/Bin
LOG: Initial PrivatePath = D:\User\repos\MyApplication\trunk\Bin\Runtime\
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyApplicationCore Runtime
Calling assembly : (Unknown).
===
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: Download of application configuration file was attempted from
file:///D:/User/repos/MyApplication/trunk/Bin/nunit-gui.exe.config.
LOG: Configuration file
D:\User\repos\MyApplication\trunk\Bin\nunit-gui.exe.config does not exist.
LOG: No application configuration file found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\conf ig\machine.config.
LOG: Attempting download of new URL
file:///D:/User/repos/MyApplication/trunk/Bin/MyApplicationCore.dll.
LOG: Assembly download was successful. Attempting setup of file:
D:\User\repos\MyApplication\trunk\Bin\MyApplicatio nCore.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: MyApplicationCore, Version=1.10.2595.28495,
Culture=neutral, PublicKeyToken=null
LOG: Re-apply policy for where-ref bind.
LOG: Where-ref bind Codebase matches what is found in default context. Keep
the result in default context.
LOG: The post-policy assembly reference requires probing again.
LOG: Switch from LoadFrom context to default context.
LOG: No application configuration file found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\conf ig\machine.config.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL
file:///D:/User/repos/MyApplication/trunk/Bin/MyApplicationCore.DLL.
LOG: Assembly download was successful. Attempting setup of file:
D:\User\repos\MyApplication\trunk\Bin\MyApplicatio nCore.dll
LOG: Entering run-from-source setup phase.
LOG: Binding succeeds. Returns assembly from
D:\User\repos\MyApplication\trunk\Bin\MyApplicatio nCore.dll.
LOG: Assembly is loaded in default load context.

Feb 8 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
If it's any help, the log is clearly saying "I cannot find your assembly in
all the standard places I am supposed to look."
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Jan" wrote:
I have a .NET 2.0 application divided in two assemblies; the exe and a dll.

The application generates a plugin-dll which is then loaded in a separate
AppDomain (along with a second instance of my application dll).

It's been working for months and now the it's not working from my
application exe anymore but still working from NUnit when testing the dll.

What could have changed in my exe? Some configuration thing in my VS2005
project?

The Fusion log from the failing load-attempt is dumped below and thereafter
a successful load from NUnit.

Notice the "Where-ref bind" in the failing attempt; C:\*** !!! - why is it
trying to load from there and not in the two directories setup in the
AppDomain?

Cheers,
Jan
****** FAILING LOAD ******

*** Assembly Binder Log Entry (08-02-2007 @ 16:37:48) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msco rwks.dll
Running under executable
D:\User\repos\MyApplication\trunk\Bin\SZStudio.vsh ost.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = SHIPMATE\JAJ
LOG: Where-ref bind. Location = C:\MyApplicationCore.dll
LOG: Appbase = file:///D:/User/repos/MyApplication/trunk/Bin
LOG: Initial PrivatePath = D:\User\repos\MyApplication\trunk\Bin\Runtime\
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyApplicationCore Runtime
Calling assembly : (Unknown).
===
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 machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\conf ig\machine.config.
LOG: Attempting download of new URL file:///C:/MyApplicationCore.dll.
LOG: All probing URLs attempted and failed.
****** WORKING - FROM NUnit ******

*** Assembly Binder Log Entry (08-02-2007 @ 16:57:00) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msco rwks.dll
Running under executable C:\Program Files\NUnit-Net-2.0
2.2.8\bin\nunit-gui.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = SHIPMATE\JAJ
LOG: Where-ref bind. Location =
D:\User\repos\MyApplication\trunk\Bin\MyApplicatio nCore.dll
LOG: Appbase = file:///D:/User/repos/MyApplication/trunk/Bin
LOG: Initial PrivatePath = D:\User\repos\MyApplication\trunk\Bin\Runtime\
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyApplicationCore Runtime
Calling assembly : (Unknown).
===
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: Download of application configuration file was attempted from
file:///D:/User/repos/MyApplication/trunk/Bin/nunit-gui.exe.config.
LOG: Configuration file
D:\User\repos\MyApplication\trunk\Bin\nunit-gui.exe.config does not exist.
LOG: No application configuration file found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\conf ig\machine.config.
LOG: Attempting download of new URL
file:///D:/User/repos/MyApplication/trunk/Bin/MyApplicationCore.dll.
LOG: Assembly download was successful. Attempting setup of file:
D:\User\repos\MyApplication\trunk\Bin\MyApplicatio nCore.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: MyApplicationCore, Version=1.10.2595.28495,
Culture=neutral, PublicKeyToken=null
LOG: Re-apply policy for where-ref bind.
LOG: Where-ref bind Codebase matches what is found in default context. Keep
the result in default context.
LOG: The post-policy assembly reference requires probing again.
LOG: Switch from LoadFrom context to default context.
LOG: No application configuration file found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\conf ig\machine.config.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL
file:///D:/User/repos/MyApplication/trunk/Bin/MyApplicationCore.DLL.
LOG: Assembly download was successful. Attempting setup of file:
D:\User\repos\MyApplication\trunk\Bin\MyApplicatio nCore.dll
LOG: Entering run-from-source setup phase.
LOG: Binding succeeds. Returns assembly from
D:\User\repos\MyApplication\trunk\Bin\MyApplicatio nCore.dll.
LOG: Assembly is loaded in default load context.
Feb 8 '07 #2

P: n/a
Yes, but WHY can't it find the file? The AppBase and PrivatePath are the same
in the two scenarios.

In the non-working scenario the log says "Where-ref bind. Location =
C:\MyApplicationCore.dll"

What does that mean? - and why is it looking in c:\ when the exe-file is
located in the same directory as the dll it is looking for
(D:\User\repos\MyApplication\trunk\Bin) ?

It has been working for a long time and I know the dll is there, but the exe
is for some reason looking the wrong place now.

Jan
Feb 8 '07 #3

P: n/a
Beats me. What's with this "trunk" deal? Whaz, this svn or something?
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Jan" wrote:
Yes, but WHY can't it find the file? The AppBase and PrivatePath are the same
in the two scenarios.

In the non-working scenario the log says "Where-ref bind. Location =
C:\MyApplicationCore.dll"

What does that mean? - and why is it looking in c:\ when the exe-file is
located in the same directory as the dll it is looking for
(D:\User\repos\MyApplication\trunk\Bin) ?

It has been working for a long time and I know the dll is there, but the exe
is for some reason looking the wrong place now.

Jan
Feb 9 '07 #4

P: n/a
Yes, running TortioseSVN.

/Jan

"Peter Bromberg [C# MVP]" wrote:
Beats me. What's with this "trunk" deal? Whaz, this svn or something?
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
Feb 9 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.