.net-assembly

Quite special PublicKey in .NET core assemblies

左心房为你撑大大i 提交于 2019-12-19 05:57:40
问题 I've noticed that core .NET assemblies have PublicKey = 00000000000000000400000000000000. Not only it's shorter then those sn.exe allows to generate (min 384 bits) but also it has a lot of zeros. How to generate signing key with such a fancy public key? 回答1: That's the ECMA Standard defined public key. It's to deal with three conflicting requirements: A mechanism that ensures that assemblies are signed by their creators and could not have been created by a fraudulent other party. That CLI be

How to load an assembly from a Stream or byte[] in WP7?

耗尽温柔 提交于 2019-12-19 02:46:06
问题 I want to load an assembly at runtime using either a Stream or a Byte array. In .net you can use Assembly.Load(Byte[], Byte[]) http://msdn.microsoft.com/en-us/library/twt16z2x.aspx In standard Silverlight you can use AssemblyPart.Load() http://msdn.microsoft.com/en-us/library/cc190521%28v=VS.96%29.aspx But in Windows Phone 7 neither of these methods are avaliable. 回答1: Well, as you pretty much discovered; you can't do it. The design doesn't allow for you to load an assembly that doesn't ship

How to programmatically determine if .NET assembly is installed in GAC?

﹥>﹥吖頭↗ 提交于 2019-12-18 12:28:50
问题 What's the easiest way to check programmatically if an assembly is registered in the GAC (Global Assembly Cache) on the local machine? Is there some easy to use .NET API where I can give it a location to an assembly DLL or an Assembly object itself to check if it exists in GAC on the local machine? In my case the assembly I'm checking will already be loaded in the current AppDomain of the program checking so I'm not sure calling Assembly.ReflectionOnlyLoad and catching an exception will work

If statement appears to be evaluating even when condition evaluates to false

末鹿安然 提交于 2019-12-18 11:36:56
问题 Late At Work last night, we were trying to figure out why something was failing. A validation check was failing when it shouldn't have been. We ended up adding a print statement to this code (disassembled from Reflector in order to check that the code was actually what we had written): public static string Redacted(string name, DateTime lastModified) { long ticks = lastModified.Ticks; if ((ticks != (ticks - (ticks % 10000L))) && (lastModified != DateTime.MaxValue)) { Log.Debug(string.Format(

How to separate model, view and controller in an ASP.NET MVC app into different assemblies

痴心易碎 提交于 2019-12-18 11:30:16
问题 At the moment I am trying to get into the ASP.NET MVC framework. For most of my test applications I used a single assembly/project. This worked fine for some smaller applications. Then I wondered how I could place my model, controller and view classes into separate assemblies? In really big web-applications it is not very realistic to put everything into a single assembly/project. So my question is: Is it possible to tell the ASP.NET MVC framework to search in another assembly for views and

Cannot find System.Net.Sockets assembly for WP 8.1

霸气de小男生 提交于 2019-12-18 09:25:40
问题 I'm trying to create an app which works as a remote-control for my musicplayer. I've just finished written a nice library for my code and I just now noticed there is no assembly called System.Net.Sockets for Windows Phone 8.1? There must be a solution to this, but I just cannot find it. Does anyone know how I might be able to import it to my project? 回答1: According to Microsoft, you should be using Windows.Networking.Sockets instead: The Windows Runtime API, Windows.Networking.Sockets, has

C# Load different versions of assembly to the same project

和自甴很熟 提交于 2019-12-18 07:43:13
问题 I'm creating some tool what performs several operations like NUnit. Inside this tool I open .dll assembly and invoke methods form it to run some test. Everything is going OK till the time I need to reload .dll withour program restart. The idea is that when tool is run we copy required assembly to some temporary folder and invoke from there. If I need to reload I copy another one to another temporary folder and try to load newly copied from another folder and load to previous assembly object

AssemblyBinding BindingRedirect not working for MVC4 app with T4MVCExtensions

不问归期 提交于 2019-12-18 05:04:36
问题 We have a large .NET web application that was MVC3, using T4MVC. We recently upgraded it to MVC4, and all is good except for T4MVCExtensions (version 3.6.5 from NuGet) is still dependent on System.Web.Mvc version 3. The runtime dependencies that you're supposed to setup in the web.config SHOULD be redirecting the assembly bindings, but they don't seem to be. The following exception occurs: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name:

How to solve Windows Azure Diagnostic Runtime Error (Could not create WindowsAzure.Diagnostics, Version=xx, Culture=neutral, PublicKeyToken=xx

早过忘川 提交于 2019-12-18 04:04:29
问题 privateLibManager libManager; private LibManager Connect() { this.libManager=new LibManager();//here we are getting an error } Error: The type initializer for 'SWConfigDataClientLib.LibManager' threw an exception Inner Exception: Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics,Version=2.2.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35. Source IpPbxCDSClientLib 回答1: First make sure you have added references to

What is Fusion in .NET Assembly

偶尔善良 提交于 2019-12-17 22:46:33
问题 In Suzanne Cook's blog there is such a description: LoadFrom Context: In general, if the user provided Fusion a path which was used to find the assembly (and the assembly at that path wouldn't have been found in the Load context), then it's in the LoadFrom context. There are various methods to load by path: LoadFrom(), CreateInstanceFrom(), ExecuteAssembly(), loading an assembly through interop using a codebase, etc. And also I found an MSDN article about it but I am not really sure whether