assemblies

How did Microsoft create assemblies that have circular references?

混江龙づ霸主 提交于 2019-11-26 05:17:38
问题 In the .NET BCL there are circular references between: System.dll and System.Xml.dll System.dll and System.Configuration.dll System.Xml.dll and System.Configuration.dll Here\'s a screenshot from .NET Reflector that shows what I mean: How Microsoft created these assemblies is a mystery to me. Is a special compilation process required to allow this? I imagine something interesting is going on here. 回答1: I can only tell how the Mono Project does this. The theorem is quite simple, though it gives

Loading multiple versions of the same assembly

那年仲夏 提交于 2019-11-26 04:50:38
问题 I\'m working with a third-party assembly and unfortunately I now need to load their latest and a previous version into my project so at runtime I can decide which one to load. I only ever need one, not both. With this in mind, I am also dependent upon the types provided by the components so I cannot load from reflection and query every time for the method/events/interfaces that I want to use. I have seen some mention of handling this via AppDomain s but am not sure how to proceed. Would the

C# compiling for 32/64 bit, or for any cpu? [duplicate]

送分小仙女□ 提交于 2019-11-26 04:38:06
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Visual Studio “Any CPU” target I\'ve noticed that when compiling C# code in VS, there\'s typically options for compiling for 32/64 bit systems, and there\'s also one for compiling for any cpu. What\'s the difference between the two options? Does choosing any CPU only compile down to an intermediate byte code while the first option compiles down to machine code (this sounds unlikely to me)? Or something else? 回答1

How do you loop through currently loaded assemblies?

一笑奈何 提交于 2019-11-26 04:07:38
问题 I\'ve got a \"diagnostics\" page in my ASP.NET application which does things like verify the database connection(s), display the current appSettings and ConnectionStrings, etc. A section of this page displays the Assembly versions of important types used throughout, but I could not figure out how to effectively show the versions of ALL of the loaded assemblies. What is the most effective way to figure out all currently referenced and/or loaded Assemblies in a .NET application? Note: I\'m not

How to fix “Referenced assembly does not have a strong name” error?

一笑奈何 提交于 2019-11-26 04:05:04
问题 I\'ve added a weakly named assembly to my Visual Studio 2005 project (which is strongly named). I\'m now getting the error: \"Referenced assembly \'xxxxxxxx\' does not have a strong name\" Do I need to sign this third-party assembly? 回答1: To avoid this error you could either: Load the assembly dynamically, or Sign the third-party assembly. You will find instructions on signing third-party assemblies in .NET-fu: Signing an Unsigned Assembly (Without Delay Signing) . Signing Third-Party

Why should you remove unnecessary C# using directives?

别说谁变了你拦得住时间么 提交于 2019-11-26 03:59:40
For example, I rarely need: using System.Text; but it's always there by default. I assume the application will use more memory if your code contains unnecessary using directives . But is there anything else I should be aware of? Also, does it make any difference whatsoever if the same using directive is used in only one file vs. most/all files? Edit: Note that this question is not about the unrelated concept called a using statement , designed to help one manage resources by ensuring that when an object goes out of scope, its IDisposable.Dispose method is called. See Uses of "using" in C# . It

When should I deploy my assemblies into the GAC?

冷暖自知 提交于 2019-11-26 03:52:21
问题 I would like to know practically what kind of Assemblies should I deploy in GAC. Case 1 : If in my Solution multiple project uses log4net.dll then should it be deployed in GAC? Case 2 : If I have multiple application deployed in a machine each using log4net.dll is this the reason enough to deploy log4net.dll into GAC? 回答1: Question: When should I deploy my assemblies into the GAC? Answer: Never Actual, honest, Real Answer: Hardly Ever Discussion Only drop things into the GAC when multiple

Single-assembly multi-language Windows Forms deployment (ILMerge and satellite assemblies / localization) - possible?

戏子无情 提交于 2019-11-26 03:50:00
问题 I have a simple Windows Forms (C#, .NET 2.0) application, built with Visual Studio 2008. I would like to support multiple UI languages, and using the \"Localizable\" property of the form, and culture-specific .resx files, the localization aspect works seamlessly and easily. Visual Studio automatically compiles the culture-specific resx files into satellite assemblies, so in my compiled application folder there are culture-specific subfolders containing these satellite assemblies. I would like

Using different versions of the same assembly in the same folder

我是研究僧i 提交于 2019-11-26 03:27:10
问题 I have the following situation Project A - Uses Castle Windsor v2.2 - Uses Project B via WindsorContainer Project B - Uses NHibernate - Uses Castle Windsor v2.1 In the bin folder of Project A I have the dll Castle.DynamicProxy2.dll v2.2 and NHibernate dlls. Now the problem is that NHibernate is dependent on Castle.DynamicProxy2.dll v2.1 which is not there. How do I resolve this situation. 回答1: I used the following configuration to resolve the issue. <configuration> <runtime> <assemblyBinding

Embedding assemblies inside another assembly

帅比萌擦擦* 提交于 2019-11-26 03:07:33
问题 If you create a class library that uses things from other assemblies, is it possible to embed those other assemblies inside the class library as some kind of resource? I.e. instead of having MyAssembly.dll , SomeAssembly1.dll and SomeAssembly2.dll sitting on the file system, those other two files get bundled in to MyAssembly.dll and are usable in its code. I\'m also a little confused about why .NET assemblies are .dll files. Didn\'t this format exist before .NET? Are all .NET assemblies DLLs,