assemblies

Signing assemblies - basics

ぃ、小莉子 提交于 2019-12-03 04:14:56
问题 What does it mean to sign an assembly? And why is it done? What is the simplest way to sign it? What is the .snk file for? 回答1: The other two answers are fine, but one additional point. It is easy to get confused between "certificate" signing and "strong name" signing. The purpose of strong name signing is as Stefan Steinegger says: to allow your customer to establish that the code they THINK they're loading really is precisely the code that they ARE loading. That is ALL strong names are for.

How to tell if a .NET assembly is dynamic?

为君一笑 提交于 2019-12-03 04:11:29
When iterating through a set of assemblies, e.g. AppDomain.CurrentDomain.GetAssemblies(), dynamic assemblies will throw a NotSuportedException if you try to access properties like CodeBase. How can you tell that an assembly is dynamic without triggering and catching the NotSupportedException? Mike Stockdale To check if the assembly is dynamic: if (assembly.ManifestModule is System.Reflection.Emit.ModuleBuilder) This took me a while to figure out, so here it is asked and answered. Update: In .NET 4.0, there is now a property: if (assembly.IsDynamic) In .NET 4 you can also check the Assembly

Decoding and understanding assembly code

ⅰ亾dé卋堺 提交于 2019-12-03 03:12:11
问题 So a little background. I am a beginner with c and assembly code, we have an "bomb" assignment (written in c)which calls methods that require certain passwords, but the code is not visible and I need to determine the correct password by looking at the assembly code. The code indicates the password for this method is 6 numbers, which is passed as "input" to method phase 2 (I am trying to avoid triggering ). The part I am getting confused on is is jumping from +64 to +42. It seems to be a loop

.Net Dynamically Load DLL

为君一笑 提交于 2019-12-03 03:09:12
I am trying to write some code that will allow me to dynamically load DLLs into my application, depending on an application setting. The idea is that the database to be accessed is set in the application settings and then this loads the appropriate DLL and assigns it to an instance of an interface for my application to access. This is my code at the moment: Dim SQLDataSource As ICRDataLayer Dim ass As Assembly = Assembly. _ LoadFrom("M:\MyProgs\WebService\DynamicAssemblyLoading\SQLServer\bin\Debug\SQLServer.dll") Dim obj As Object = ass.CreateInstance(GetType(ICRDataLayer).ToString, True)

Could Not Load Assembly .NET 4.0

自作多情 提交于 2019-12-03 03:04:39
whenever I build my web solution I get this error : Could not load file or assembly 'dotless.Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=96b446c9e63eae34' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) I have VS 2010 with .NET 4.0 on Windows 7. The dlls are located inside the Bin folder of the Web Application. Any suggestions? Thanks. I deleted temporary asp.net files in : C:\users\username\AppData\Local\Temp\Temporary ASP.NET Files\ And it worked. had the same problem! I found that you need to use a different location for

WCF extensions without including the assembly version

谁都会走 提交于 2019-12-03 02:35:46
As discussed here , I'm trying to add a WCF endpoint-extension; I've got it working, but I need to include the full assembly details: <extensions> <behaviorExtensions> <add name="protobuf" type="ProtoBuf.ServiceModel.ProtoBehaviorExtension, protobuf-net, Version=1.0.0.275, Culture=neutral, PublicKeyToken=257b51d87d2e4d67"/> </behaviorExtensions> </extensions> What I would like to do (to avoid issues when updating etc, especially for samples) is to include just the names: <add name="protobuf" type="ProtoBuf.ServiceModel.ProtoBehaviorExtension, protobuf-net"/> (which is what you might expect

How to mark a .net assembly as safe?

China☆狼群 提交于 2019-12-03 01:41:47
How do i mark as assembly as "safe"? Alternatively, how do i have Visual Studio tell me when something in my assembly is not "safe"? Sometimes you cannot use an assembly unless it is "safe" (e.g. from SQL Server ). i would like my assembly to be marked as safe. If my assembly cannot be marked as safe because it's not safe, i'd like to know how i can know that my assembly is not safe. There are some concepts in Visual Studio that seem to relate to safe-ness, that may or may not have anything to do with an assembly being "safe": Allow unsafe code assembly option: What is allowed if i check the

What are the `exact` differences between .NET dll and a normal dll?

孤街浪徒 提交于 2019-12-03 01:41:18
问题 I want to know what are the exact differences between .NET dll and a normal dll. First question, what is "normal DLL" called? I'm using the word 'normal'. But it doesnt seem right? Because both follow the PE format. Yeah, I agree that .NET DLL has an extra section. Other than that every thing else is same. I also know that in .NET code is converted into CIL/MSIL then what is filled in .text section of PE file? MSIL? because there is no binary code. But if they put MSIL in .text section.

Good way to preload .NET assembly

只愿长相守 提交于 2019-12-03 01:21:44
In my app I need to show a form on mouse click. The problem is that the form is in another assembly and because of lazy nature of assembly loading it is likely that the assembly isn't loaded yet when the mouse button is pressed. So what I have is very noticeable pause before the form finally appears. I was able to come up with a dumb fix by calling new FormFromAnotherAssembly() in my initialization method. That, of course, took care of things and the pause is no longer there, but it's very ugly. The only thing I like about this solution is that I don't have to mess with paths and assembly

Assembly File Version not changing?

陌路散爱 提交于 2019-12-03 01:21:01
I have in my assemblyinfo.cs class the code: [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyFileVersion("1.0.*")] Calling System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() works fine and gives the updated version, however, when i look at the generated dll in windows explorer, right click properties, click the 'details' tab, the fileversion says "1.0.0.0" even though the output above says 1.0.3489.17621 ? You cannot use 1.0.* to auto-increment the AssemblyFileVersion, only the AssemblyVersion. (Checked in all Visual Studio versions from 2005 to 2012).