assemblies

Weird behaviour when mixing loading of assemblies using Assembly.LoadFrom and Assembly.Load

巧了我就是萌 提交于 2019-12-19 19:21:58
问题 Weird behavior when mixing loading of assemblies using Assembly.LoadFrom and Assembly.Load I have encountered a weird behavior when loading assemblies with Assembly.LoadFrom and later on with Assembly.Load. I am loading an assembly using Assembly.LoadFrom, where the assembly is located in a folder which is not the execution folder. Later on in my test code when I try to load once again this assembly with Assembly.Load, the load fails with a System.IO.FileNotFoundException (“Could not load

Weird behaviour when mixing loading of assemblies using Assembly.LoadFrom and Assembly.Load

旧城冷巷雨未停 提交于 2019-12-19 19:21:11
问题 Weird behavior when mixing loading of assemblies using Assembly.LoadFrom and Assembly.Load I have encountered a weird behavior when loading assemblies with Assembly.LoadFrom and later on with Assembly.Load. I am loading an assembly using Assembly.LoadFrom, where the assembly is located in a folder which is not the execution folder. Later on in my test code when I try to load once again this assembly with Assembly.Load, the load fails with a System.IO.FileNotFoundException (“Could not load

Is it possible to reference different version of the same assembly into a single project?

拟墨画扇 提交于 2019-12-19 18:57:12
问题 In my solution, I have several projects which use Log4Net (1.2 and 2.5). Then I have a project where I do all the unit testing (of the other projects). So I'm in a situation where depending on what I test/mock I would need Log4Net 1.2 or 2.5. I read you could support different version of a single assembly in an application (using codebase etc.) but is it even possible to support different version of a single assembly into a project? If so, how? EDIt: Here's a tiny (2 classes, 2 methods, 2

The Order of Assemblies Being Loaded

百般思念 提交于 2019-12-19 17:56:09
问题 I have a few .Net assemblies, same version, same file name, but located at different location: Program folder C:\Windows C:\Windows\system32 GAC Now, which location's assembly will be loaded first? 回答1: .Net assemblies has different search order than regular windows .dll. GAC will be checked the first thing ONLY if the assembly is strongly named signed. If the assembly is not in the gac / not strong name signed , the local folder is checked after that. That is the end of the .net assembly

Why exactly does regasm warn me about signing with a strong name?

陌路散爱 提交于 2019-12-19 17:41:06
问题 If I want to make a .NET assembly usable as a COM server I have to add a set of attributes and then use regasm to register it as a COM server. If the assembly is not signed with a strong name regasm when run with /codebase key shows a RA0000 warning saying that the assembly could interfere with other assemblies on the same computer and I should sign it with a strong name, but registration succeeds and it even works just fine. AFAIK strong names are intended to prevent so-called DLL hell. But

How to set “Specific Version” property for project references in Visual Studio

ぃ、小莉子 提交于 2019-12-19 17:13:23
问题 I have got a Visual Studio Solution containing several projects and have set up the references between the projects as project references. When a reference to an assembly is added, the references' properties contain a setting for Specific Version = True|False This property is missing for project references. How can it be set? I'd like my solution to load any available assembly (no matter what version) in the bin folder. I've had a problem when a workflow instance (Workflow Foundation) was

How to forbid a .NET DLL class library to be referenced

做~自己de王妃 提交于 2019-12-19 09:37:47
问题 How can I forbid dll class library to be referenced in other solutions? 回答1: You could look into adding a StrongNameIdentityPermission to your class library that matches the strong name of the program you do want to be able to use it with. Alternatively, you could explore using InternalsVisibleToAttribute, although it may require some design changes in your library code. This should work as long as neither assembly is signed, or both are signed with a strong name. The argument specified on

Visual Studio adding executable file with same name as dll

十年热恋 提交于 2019-12-19 06:17:53
问题 In Visual Studio 2008, I added WinScp.dll (in project root) as a reference and immediately there was a yellow icon. At compile-time: The type or namespace name 'WinSCP' could not be found (are you missing a using directive or an assembly reference?) Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'E:...\winscp.exe' or one of its dependencies. The module was expected to contain an assembly manifest. After an hour's frustration, I