assemblies

Can dependency injection prevent a circular dependency?

核能气质少年 提交于 2019-11-26 23:11:40
问题 Project#1 has some interfaces and classes that project#2 references. Now I want to use the implementation of Project#2 in Project#1 but vs.net complains about a circular dependency. If I was to use dependancy injection in Project#1 and bind to the implementation in Project#2 (since it adheres to the interface contract), will this work or I will still get the circular dependency error message at runtime? 回答1: You probably could solve this with DI, but you shouldn't . If I understand correctly,

How to build/deploy project that requires multiple versions of the same assembly?

旧巷老猫 提交于 2019-11-26 22:59:16
问题 I am working on a project that uses conflict.dll version 6.2, but the project also uses helper.dll that uses conflict.dll version 5.8. I could install 6.2 and 5.8 into the GAC, but I'ld like to have this project xcopy deployable. I believe .net will search for the assemblies in the application bin directory like so: \bin\conflict.dll (6.2) \bin\5.8\conflict.dll (5.8) But at this point, how do I add a reference to both versions of conflict.dll in the project, and then how do I make sure the

How do I implement .net plugins without using AppDomains?

我与影子孤独终老i 提交于 2019-11-26 22:56:42
问题 Problem statement: Implement a plug-in system that allows the associated assemblies to be overwritten (avoid file locking). In .Net, specific assemblies may not be unloaded, only entire AppDomains may be unloaded. I'm posting this because when I was trying to solve the problem, every solution made reference to using multiple AppDomains. Multiple AppDomains are very hard to implement correctly, even when architected at the start of a project. Also, AppDomains didn't work for me because I

How do I merge multiple .net assemblies into a single assembly?

断了今生、忘了曾经 提交于 2019-11-26 22:33:25
I have a .net application with about 10 assemblies. It would be nice to have them all together as a single assembly. How do I do it? I guess something like a jar file for Java applications. Try ILMerge . Dirk Vollmar Using ILMerge is probably the simplest solution. However, ILMerge has the drawback that it changes the identity of referenced assemblies. As a consequence, you might run into issues with security or serialization. An excellent blog post by Simone Busoli discusses the following options to merge assemblies into a single executable: ILMerge Embedding assemblies as a resource and

Best practices for signing .NET assemblies?

萝らか妹 提交于 2019-11-26 22:33:03
问题 I have a solution consisting of five projects, each of which compile to separate assemblies. Right now I'm code-signing them, but I'm pretty sure I'm doing it wrong. What's the best practice here? Sign each with a different key; make sure the passwords are different Sign each with a different key; use the same password if you want Sign each with the same key Something else entirely Basically I'm not quite sure what "signing" does to them, or what the best practices are here, so a more

AppDomain.CurrentDomain.AssemblyResolve asking for a <AppName>.resources assembly?

ⅰ亾dé卋堺 提交于 2019-11-26 22:16:42
问题 using the code How to embed a satellite assembly into the EXE file provided by csharptest.net, I've created a custom assembly resolver and embedded my assemblies in my resources. I can successfully resolve my assemblies used in but somehow AppDomain.CurrentDomain.AssemblyResolve asks for an assembly called 'AppName.resources' specifically "MyProgram.resources, Version=0.15.3992.31638, Culture=en-US, PublicKeyToken=null" which i don't know how to resolve? I've tried to disable loading my

Could not load assembly System.Data.SQLite.dll

牧云@^-^@ 提交于 2019-11-26 22:04:36
问题 I have a perfectly working windows forms C# .NET 4 application that uses a SQLite3 database file to store data and display forms. When I deploy my app on any machine other then the dev machine, I get an exception thrown and it's message is "Could not load assembly System.Data.SQLite.dll or one of its dependencies. The specified module could not be found." The System.Data.SQLite.dll reference in the project is set to Copy Local = True. Also, I tried manually loading the assembly with Assembly

How to find out if a .NET assembly was compiled with the TRACE or DEBUG flag

只谈情不闲聊 提交于 2019-11-26 22:04:01
问题 Is there any way to find out if an assembly has been compiled with the TRACE or DEBUG flag set without modifying the assembly? 回答1: The only best way to do is check the compiled assemblies itself. There is this very useful tool called '.NET Assembly Information' found here by Rotem Bloom. After you install this it asociates .dll files to open with itself. After installing you can just double-click on the Assembly to open with it and it will give you the assembly details as displayed in the

How to load a .NET assembly for reflection operations and subsequently unload it?

自作多情 提交于 2019-11-26 21:54:15
I'm writing a tool to report information about .NET applications deployed across environments and regions within my client's systems. I'd like to read the values of assembly attributes in these assemblies. This can be achieved using Assembly.ReflectionOnlyLoad , however even this approach keeps the assembly loaded. The issue here is that I cannot load two assemblies that have the same name from different paths, so naturally I can't compare the same application deployed in different systems. At this point I'm assuming the solution will involve using temporary AppDomain s. Can someone detail how

How can I merge resource files in a Maven assembly?

╄→尐↘猪︶ㄣ 提交于 2019-11-26 21:47:35
问题 I'm using Maven and its assembly plugin to build a distribution package of my project like this: one project assembles a basic runtime (based on Felix), with the appropriate directories and bundles, in a ZIP file. third-party libraries are collected in one project each and either converted to OSGi bundles or, if they are already OSGi compatible, they are just copied my own project consists of several modules that are built into OSGi bundles, too. Now, I'm adding another project that unpacks