Deploying Assembly and Loading
-
Hi there, Well, I am facing some problems while loading an assembly dynamically from a subdirectory located in ApplicationBase. The code works just fine when this dll is located in the application directory but when I tried to load it from one of the application's subdirectory it is not working even when I tried following options: First, I created a "test" subdirectory for my test.dll(As far as my understanding of deploying a private assembly goes I believe runtime locates dll in application directory then it looks for a subdirectory having dll's name e.g. temp in this case and finally it goes to GAC.) Second, I get following error log from fusion LOG: Private path hint found in configuration file: test. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). where test is the subdirectory I am putting this dll. I have included in app.config but it doesn't seem to work. Also I have tried to use tags and made this assembly strong named and unfortunately that didn't work either. Additionally, I have tried both LoadFrom() and Load() methods but no help. As far as my understanding goes I think I do not need to create a strong named assembly when I am using probing element in config. Any suggestions would be greatly appreciated. Thanks in advance. -Subby:) -- modified at 13:55 Sunday 26th March, 2006
-
Hi there, Well, I am facing some problems while loading an assembly dynamically from a subdirectory located in ApplicationBase. The code works just fine when this dll is located in the application directory but when I tried to load it from one of the application's subdirectory it is not working even when I tried following options: First, I created a "test" subdirectory for my test.dll(As far as my understanding of deploying a private assembly goes I believe runtime locates dll in application directory then it looks for a subdirectory having dll's name e.g. temp in this case and finally it goes to GAC.) Second, I get following error log from fusion LOG: Private path hint found in configuration file: test. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). where test is the subdirectory I am putting this dll. I have included in app.config but it doesn't seem to work. Also I have tried to use tags and made this assembly strong named and unfortunately that didn't work either. Additionally, I have tried both LoadFrom() and Load() methods but no help. As far as my understanding goes I think I do not need to create a strong named assembly when I am using probing element in config. Any suggestions would be greatly appreciated. Thanks in advance. -Subby:) -- modified at 13:55 Sunday 26th March, 2006
Hi, I usually use this method
AppDomain.CurrentDomain.AppendPrivatePath( path )
to add a directory (e.g. for plugins) that the assembly resolver should include in its probing. Hope this helps, Tim -
Hi, I usually use this method
AppDomain.CurrentDomain.AppendPrivatePath( path )
to add a directory (e.g. for plugins) that the assembly resolver should include in its probing. Hope this helps, TimThanks, I tried the AppendPrivatePath method and had the similar problem. I finally figured out the problem. It is little silly but I didn't know that the problem was because of changing method from LoadFrom(which requires complete filename) to Load. In the load method I was giving the complete dll name e.g. test.dll so the runtime was looking for directories library test.dll.dll :) Thanks Anyway.