assembly-resolution

Use types of same name & namespace in 2 .NET assemblies

[亡魂溺海] 提交于 2019-12-18 07:43:23
问题 Out of curiosity, I've created 2 assemblies which both have a class ( Class1 ) with the exact same namespace ( Library1 ). I then create another client referencing those 2 assemblies and try to create an instance of Class1 . The compiler, not surprisingly, gives me a compile-error about the ambiguous reference. Is there any way to explicitly specify the type in the assembly I want to use to avoid the ambiguity? Note: I know this rarely, if ever at all, happens in practice. It's just a

Runtime error when trying to run Fluent NHibernate tutorial example

烈酒焚心 提交于 2019-12-17 21:34:32
问题 I worked through the Fluent NHibernate tutorial at http://wiki.fluentnhibernate.org/Getting_started and the project compiles fine. However, I am getting a runtime error and I can't seem to resolve it. The error is happening in the CreateSessionFactory method you can see in the tutorial. Here it is: private static ISessionFactory CreateSessionFactory() { return Fluently.Configure() .Database ( SQLiteConfiguration.Standard .UsingFile(DbFile) ) .Mappings(m => m.FluentMappings.AddFromAssemblyOf

Upgrade a reference dll in a C# project without recompiling the project

谁说胖子不能爱 提交于 2019-12-17 17:56:16
问题 I need to take a built version of an C# application and change one of the reference dll's. What is the best way to do this, I have specific version turned off on the reference dll but as soon as I test replacing the dll with a newer version, I get the "Could not load file or assembly XXXXX, Version=XXXXX. Is there a way to stop the loader from caring about the version of the dll so the dll will just attempt to load? 回答1: Yes, you can do this - see the MSDN article Redirecting Assembly

Need to hookup AssemblyResolve event when DisallowApplicationBaseProbing = true

不想你离开。 提交于 2019-12-17 13:22:56
问题 I need to hookup an AssemblyResolve event on my created AppDomain when I've set DisallowApplicationBaseProbing = true. The reason I'm doing this is to force the runtime to call the AssemblyResolve event it needs to resolve an assembly, instead of probing first. This way, another developer can't just stick MyDllName.dll in the ApplicationBase directory and override the assembly I wanted to load in the AssemblyResolve event. The issue with doing this is the following... class Program { static

What is the meaning of Default/NativeImage in fuslogvw?

好久不见. 提交于 2019-12-12 12:19:34
问题 I occasionally use fuslogvw to track down problems loading assemblies. After all my time of using it, it seems that the folder 'NativeImage' has results for loading native images of my dlls. When the native image is not found (usually its not), I think it then looks for a .net assembly. The 'default' folder is what I normally care about, because it has logs for all assembly bindings, which is where my problem typically lies. Can anyone explain the real difference here? 回答1: The native images

Inexplicable Assembly Load in WCF Service (IIS 7)

旧城冷巷雨未停 提交于 2019-12-10 19:17:23
问题 I'm working on a new WCF web service that's to be hosted within an existing ASP.NET web application. When I attempt to run the .svc file for the service, I'm getting an exception that it can't find the file for an assembly. Could not load file or assembly 'System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified. The trouble is, this service doesn't appear to reference this (particular)

how can I embed an assembly into a console application without ILMerge?

不羁岁月 提交于 2019-12-10 11:40:31
问题 There are a lot of posts on here about this, I'm using this code from another SO post and placing a delegate assignation in my Main() method. None of the other posts have directly answered my question. I've got my third party assembly embedded as a resource but when I fire up the app: I'm getting a TypeInitializationException with an inner of FileNotFoundException. It's trying to find the assembly on the file system and failing. it's never getting to the Main method, where the event handler

Loading assemblies and versioning

本秂侑毒 提交于 2019-12-09 00:50:25
问题 I'm contemplating adding some extensibility into an existing app by providing a few predefined interfaces that can be implemented by "plugins" dropped at a specific location and picked up by the app. The core of the application rarely gets updated while the plugins are updated and deployed more frequently. So basically, having a setup like this: // in core assembly (core.dll) public interface IReportProvider{ string GenerateReport(); } // in other assembly(plugin.dll) public class

Windows service locks up on assembly load

大兔子大兔子 提交于 2019-12-08 02:45:31
问题 I have a Windows Service written in C#. It includes a standalone console mode as well, for debugging purposes. It works fine on almost every computer it's been run on, but we ran into a situation where this service locks up when you try to start it, and then it gets killed because of timeout. But when running it in console mode on the same machine, it starts up fine. It's a pain to debug because I don't actually have access to the machine this is happening on, I have to go through a human

probing privatePath and subdirectories

喜欢而已 提交于 2019-12-07 04:01:05
问题 In my application I would like to put DLL files in a subdirectory. I'm using the probing element in app.config and it works quite fine, but I've got an issue with localization assemblies. <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="libs"/> </assemblyBinding> If I have two DLLs in: libs/de/myAssembly.dll and libs/myAssembly.dll The first one is loaded, while I want that the file in the root folder is preferred. How can I achieve this? 回答1: You can set