assemblies

C#: why sign an assembly?

99封情书 提交于 2019-11-26 21:33:35
In some C# code I have taken over (in Visual Studio 2005), I have noticed that the assemblies are all signed with the same .snk file. Why would the previous author have signed the assemblies in this way? Is signing assemblies necessary and what would be wrong with not signing? What disadvantages are there in signing assemblies - does it cause delays? Why would the previous author have signed the assemblies in this way? No idea, maybe he wanted all his assemblies to be signed with the same key. Is signing assemblies necessary and what would be wrong with not signing it? No, it is not necessary

Binding redirect problem in .net

元气小坏坏 提交于 2019-11-26 21:32:45
问题 I have a class library called "MyAssembly" that is internally referencing a.dll, b.dll of version 3.1.1.0; I have build the project which outputed MyAssembly.dll. On a different system (box) I have created a web application project and referenced the MyAssembly.dll. the new system has new versions of a.dll and b.dll 4.0.0; I used binding redirect in web.config like below. But still unable to compile the web application. it says missing assembly reference a.dll, version 3.1.1.0. Could any body

Unable to uninstall an Assembly from GAC?

妖精的绣舞 提交于 2019-11-26 20:35:52
问题 I am unable to uninstall an Assembly (log4net.dll) from GAC. It is giving following error. "Assembly is required by one or more applications". However if I search the Assembly using ProcessExplorer nothing comes up? How can I remove this Assembly from GAC? 回答1: Have you considered reading this KB article and trying it out? Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you

How to load Assembly at runtime and create class instance?

无人久伴 提交于 2019-11-26 20:21:25
I have a assembly. In this assembly I have a class and interface. I need to load this assembly at runtime and want to create an object of the class and also want to use the interface. Assembly MyDALL = Assembly.Load("DALL"); // DALL is name of my dll Type MyLoadClass = MyDALL.GetType("DALL.LoadClass"); // LoadClass is my class object obj = Activator.CreateInstance(MyLoadClass); This is my code. How could it be improved? If your assembly is in GAC or bin use the assembly name at the end of type name instead of Assembly.Load() . object obj = Activator.CreateInstance(Type.GetType("DALL.LoadClass,

How to organize F# source of large project (>300 classes) in Visual Studio?

谁说胖子不能爱 提交于 2019-11-26 19:52:16
问题 In C# you can put files in folders corresponding to their namespaces and view them in the Solution explorer. In F# it seems I have to put everything in plain specifically ordered list for compilation. When I get to scale of ~300 of classes it gets a bit confusing and disorganized and I start to envy C# and think that probably it is the price for type inference. Are there better options than splitting to several assemblies? Judging by F# compiler source its the route they have taken but I have

Is a Java package the equivalent of a .Net assembly?

与世无争的帅哥 提交于 2019-11-26 19:42:48
问题 I am a .Net developer starting Java development for Android and would like to know if it's correct to think of Java packages like .Net assemblies. 回答1: No. The best comparison would be with a Java ARchive (Jar) file. Java uses packages to control the namespace, and is very similar to C#'s Namespaces. Here is how I'd compare the environments Java .Net ==== ==== Class Class Package Namespace Jar Assembly 回答2: No, I think a Java package would be more similar to a namespace And an assembly would

Determine framework (CLR) version of assembly

好久不见. 提交于 2019-11-26 18:44:20
From the command line (or by any means really), how can I determine which CLR version a .NET assembly requires? I need to determine if an assembly requires 2.0 or 4.0 CLR version. ildasm.exe will show it if you double-click on "MANIFEST" and look for "Metadata version". By default, it's the version that the image was compiled against. Fernando Gonzalez Sanchez One clarification... The problem with all the mentioned methods is that they will return version 4.0 if assembly was compiled against .NET framework 4.0, 4.5 or 4.5.1. The way to figure out this version programmatically at runtime is

C# - Referencing a type in a dynamically generated assembly

倾然丶 夕夏残阳落幕 提交于 2019-11-26 18:21:42
问题 I'm trying to figure out if it's possible when you are dynamically generating assemblies, to reference a type in a previously dynamically generated assembly. For example: using System; using System.CodeDom.Compiler; using System.Reflection; using Microsoft.CSharp; CodeDomProvider provider = new CSharpCodeProvider(); CompilerParameters parameters = new CompilerParameters(); parameters.GenerateInMemory = true; CompilerResults results = provider.CompileAssemblyFromSource(parameters, @" namespace

ASP.NET - AppDomain.CurrentDomain.GetAssemblies() - Assemblies missing after AppDomain restart

偶尔善良 提交于 2019-11-26 18:09:38
问题 I have a Bootstrapper that looks through all Assemblies in an ASP.NET MVC application to find types that implement an IBootstrapperTask interface, and then registers them with an IOC Contrainer. The idea is that you can literaly place your IBootstrapperTasks anywhere, and organise your Projects how you please. Code for Bootstrapper: public class Bootstrapper { static Bootstrapper() { Type bootStrapperType = typeof(IBootstrapperTask); IList<Assembly> assemblies = AppDomain.CurrentDomain

Determine whether .NET assemblies were built from the same source

南笙酒味 提交于 2019-11-26 18:06:15
问题 Does anyone know of a way to compare two .NET assemblies to determine whether they were built from the "same" source files? I am aware that there are some differencing utilities available, such as the plugin for Reflector, but I am not interested in viewing differences in a GUI, I just want an automated way to compare a collection of binaries to see whether they were built from the same (or equivalent) source files. I understand that multiple different source files could produce the same IL,