I have a user control hosted in IE doing Remoting. The remotable(hosted in IIS) and the user control client both share an assembly. This assembly contains common object definitions.
We used AppendPrivatePath in .NET framework 1.x so that IE can load the shared assembly for the user control.
I am unable to get this control working in .NET framework 2.x. I tried creating a new AppDomain and creating a config file iexplore.exe.config. I have put this config file in the same directory as iexplore.exe, I also tried putting it under my application directory.
But no matter what I do iexplore.exe complains that it cannot find the assembly. Here is the code I tried using the AppDomainSetup class
AppDomainSetup domaininfo = new AppDomainSetup();domaininfo.ApplicationBase =
"http://localhost/CAClient/";domaininfo.PrivateBinPath =
"http://localhost/CAClient/";domaininfo.ApplicationName =
"CAClient"; //// Create the application domain.domain =
AppDomain.CreateDomain("CAClient", null, domaininfo);My Share dll is under http://localhost/CAClient/
This code is not changing the bin path for the current domain. And IE is only looking in the current domains path. What is wrong with this code Any Suggestions
Before I used to do AppDomain.CurrentDomain.AppendPrivatePath, where it is clearly changing the path for CurrentDomain, but with AppDomainSetup how can I change CurrentDomain
This is the output from Fusion log
*** Assembly Binder Log Entry (3/1/2006 @ 4:46:01 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Program Files\INTERN~1\IEXPLORE.EXE
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = SMS_EMG0\kuchsr00
LOG: DisplayName = DbShare
(Partial)
LOG: Appbase = http://localhost/
LOG: Initial PrivatePath = bin
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = IEXPLORE.EXE
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v2.0.50727\config\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 http://localhost/DbShare.DLL.
LOG: Attempting download of new URL http://localhost/DbShare/DbShare.DLL.
LOG: Attempting download of new URL http://localhost/bin/DbShare.DLL.
......
LOG: All probing URLs attempted and failed.
Thanks
Jay

AppendPrivatePath - Obsolete
RJHarris0
I believe that you are running into this problem since you are not the one creating the domain for your code. I cannot quite tell from your code sample above (since it ends), but do you then load some code in the other domain that you attempt to call
Why not follow the IE download rules and put your assemblies where the loader is looking and then either re-deploy on the server or have your code on the server do the extra gymnastics. For the client-side, I think that you want to go with the most plain-jane type solution.
hth -- rich
Mv45
Thanks for your reply. I did solve this issue; Sorry, I did not get a chance to update before.
I followed the steps suggested in the AppendPrivatePath documentation, but I could never understand how by creating a domain and setting path in it would change the current domain or how the code would run in that new domain magically.
I did put all the dll's in the bin of the virtual directory, but it never loaded that dll, even though Fusion Log says it is looking in bin.
I solved it by handling AssemblyResolve event for the current domain. AppDomain raises this event whenever it tries to find an Assembly. I simply do an Assembly.Load in the event handler for the assembly it wants. I can load the assembly from any path I want.
-Srini