assemblies

How can I reference a dll in the GAC from Visual Studio?

喜欢而已 提交于 2019-11-26 15:27:30
问题 This assembly is in the GAC: Microsoft.SqlServer.Management.RegisteredServers.dll How can I add a reference to this assembly in Visual Studio? I can view the file in c:\windows\assembly\ 回答1: As the others said, most of the time you won't want to do that because it doesn't copy the assembly to your project and it won't deploy with your project. However, if you're like me, and trying to add a reference that all target machines have in their GAC but it's not a .NET Framework assembly: Open the

How slow is Reflection

泪湿孤枕 提交于 2019-11-26 15:16:23
问题 I recently created an interface layer to distinguish the DataAccessProvider from our Business logic layer. With this approach we can change our choice of DataAccessProvider whenever we want by changing the values in the Web/App.Config. (more details can be given if needed). Anyway, to do this we use reflection to accomplish our DataProvider class on which we can work. /// <summary> /// The constructor will create a new provider with the use of reflection. /// If the assembly could not be

How do you loop through currently loaded assemblies?

痴心易碎 提交于 2019-11-26 15:01: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 interested in file-based methods, like iterating through *.dll in a particular directory. I am interested

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

℡╲_俬逩灬. 提交于 2019-11-26 14:53:21
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? 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 Assemblies The basic principle to sign a thirp-party is to Disassemble the assembly using ildasm.exe and save the

How can I get the assembly file version

心已入冬 提交于 2019-11-26 14:48:57
In AssemblyInfo there are two assembly versions: AssemblyVersion : Specify the version of the assembly being attributed. AssemblyFileVersion : Instructs a compiler to use a specific version number for the Win32 file version resource. The Win32 file version is not required to be the same as the assembly's version number. I can get the Assembly Version with the following line of code: Version version = Assembly.GetEntryAssembly().GetName().Version; But how can I get the Assembly File Version ? Xiaofu See my comment above asking for clarification on what you really want. Hopefully this is it:

When should I deploy my assemblies into the GAC?

假如想象 提交于 2019-11-26 14:20:51
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? 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 apps on the machine will use the assembly, and when the assembly is foundational (likely to be used by multiple

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

别来无恙 提交于 2019-11-26 14:16:24
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 to have the application be deployed (copied into place) as a single assembly , and yet retain the

Does .NET assembly size affect performance?

浪尽此生 提交于 2019-11-26 12:56:30
问题 Does the size of a .net assembly affect performance at all? How about the number of assemblies in your windows forms/web forms project? 回答1: From Microsoft's Patterns & Practices Improving .NET Application Performance and Scalability Chapter 5: Prefer Single Large Assemblies Rather Than Multiple Smaller Assemblies To help reduce your application’s working set, you should prefer single larger assemblies rather than multiple smaller assemblies. If you have several assemblies that are always

Embedding assemblies inside another assembly

纵饮孤独 提交于 2019-11-26 12:50:52
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, but not all DLLs are .NET assemblies? Why do they use the same file format and/or file extension? AtliB

How can I view MSIL / CIL generated by C# compiler? Why is it called assembly?

夙愿已清 提交于 2019-11-26 12:35:26
问题 I\'m new to .NET C# programming. I\'m following few books. It is said that instead of compiling it directly to binary code (Native code). High level code is converted into intermediate language (called MSIL aka CIL). But when I compile, I get an exe/Dll file. Is this MSIL/CIL containted in these exe/dll file? I want to see that intermediate language code. Just to get feel of its existence. How to view it? They are calling this exe/dll file an assembly . Are they using this \"fancy word\" just