.net-assembly

How to avoid loading unnessecary assemblies

五迷三道 提交于 2019-12-01 23:27:46
问题 ASP.NET .NET 4.6 MVC4 application loads unnessecary assemblie, eq. System.Data.OracleClient . Oracle is not used. Assembly dependencies are created using code in controller var sb = new StringBuilder(); foreach (Assembly b in AppDomain.CurrentDomain.GetAssemblies()) { sb.AppendLine(b.FullName); foreach (AssemblyName an in b.GetReferencedAssemblies()) sb.AppendLine(" " + an.Name); } Output is below. According to this System.Web references to System.Design and System.Design references to System

How to find an assembly name for a .NET namespace, for example, Microsoft.WindowsAzure.ServiceRuntime

不羁岁月 提交于 2019-12-01 20:51:25
问题 I have a generic question, and specific example. This should be easy according to all the similar questions on Stack Overflow regarding assemblies for namespaces. The most common answer is found in question How do I know what reference to include to import a specific .NET namespace? . "All MSDN doc pages mention namespace and assembly." However on this MSDN page there is no mention of the assembly. What obvious thing am I missing? Microsoft.WindowsAzure.ServiceRuntime Namespace Revised: More

How to find an assembly name for a .NET namespace, for example, Microsoft.WindowsAzure.ServiceRuntime

爱⌒轻易说出口 提交于 2019-12-01 18:40:27
I have a generic question, and specific example. This should be easy according to all the similar questions on Stack Overflow regarding assemblies for namespaces. The most common answer is found in question How do I know what reference to include to import a specific .NET namespace? . "All MSDN doc pages mention namespace and assembly." However on this MSDN page there is no mention of the assembly. What obvious thing am I missing? Microsoft.WindowsAzure.ServiceRuntime Namespace Revised: More specifically I'm looking for the DLL file to include for the Azure class RoleEnvironment. When I hit F1

BitmapSource from embedded image

匆匆过客 提交于 2019-12-01 18:14:21
问题 My goal is to draw image "someImage.png", which is embedded resource, on WPF window, in overridden OnRender method: protected override void OnRender(System.Windows.Media.DrawingContext drawingContext) { base.OnRender(drawingContext); drawingContext.DrawImage(ImageSource, Rect); } I found code to get my image from resources to Stream: public BitmapSource GetSourceForOnRender() { System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly(); Stream myStream =

Hololens Build Failing - The command AssemblyConverter.exe exited with code 1

℡╲_俬逩灬. 提交于 2019-12-01 18:11:50
After updating to the latest version of VS 2017 (version 15.3.2) my Hololens builds generated from Unity keep failing with this message : The command ""C:\TestFile\HoloBuild\VSApp\Unity\Tools\AssemblyConverter.exe" -platform=uap -lock="C:\TestFile\HoloBuild\VSApp\HoloBuild\project.lock.json" -bits=32 -configuration=Debug -removeDebuggableAttribute=False -uwpsdk=10.0.15063.0 -path="." -path="C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\dotnet\x86\Debug" "C:\TestFile\HoloBuild\VSApp\HoloBuild\Assembly-CSharp.dll" "C:\TestFile\HoloBuild\VSApp\HoloBuild\UnityEngine

What is best practise when instantiating a Castle Windsor container in a class library? [duplicate]

邮差的信 提交于 2019-12-01 18:00:17
This question already has an answer here: Dependency Inject (DI) “friendly” library 4 answers I am wondering where the best place to instantiate the castle Windsor container is in a class library. Should I simply do it in the constructor of the class I am using or is there a single entry point for assemblies that I am unaware of? Thanks. The configuration of an injected object graph is entirely dependent on the needs of the application that actually uses it. The point of using the container is to be able to configure dependencies at runtime - a library doesn't know anything about how it's

C# dynamic compilation and “Microsoft.CSharp.dll” error

柔情痞子 提交于 2019-12-01 17:49:06
I'm doing the example that can be found here . So I'm trying to run IronPython in a C# script: Python: def hello(name): print "Hello " + name + "! Welcome to IronPython!" return def add(x, y): print "%i + %i = %i" % (x, y, (x + y)) return def multiply(x, y): print "%i * %i = %i" % (x, y, (x * y)) return C#: using IronPython.Hosting; using IronPython.Runtime; using Microsoft.Scripting.Hosting; using System; namespace IntroIronPython { class IronPythonMain { static void Main(string[] args) { // Create a new ScriptRuntime for IronPython Console.WriteLine("Loading IronPython Runtime...");

Xamarin Forms IOS Failed to load assembly System.Net.Http.Primitive

五迷三道 提交于 2019-12-01 17:48:03
问题 I'm trying to do a release build for an IOS app using Xamarin.Forms in Visual Studio 2015. Under the iOS Build menu in the properties of the app, If I set the Linker behaviour Link SDK assemblies only or Link all assemblies - I get the following build error: Failed to resolve assembly: 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' BlackhawkPlatform.App.iOS If I don't link any of the assemblies - the App builds fine but the output ipa is over

What is the “<Module>” type?

我只是一个虾纸丫 提交于 2019-12-01 17:38:53
问题 I am using Mono.Cecil to read an assembly generated by Regex.CompileToAssembly() . When I iterate through the types, there is one type in the root namespace named <Module> . The type has no base type. What is this type? Is this some Mono.Cecil artifact or something that is actually a real part of .NET assemblies? What role does it play? 回答1: The <Module> type is a place-holder for declarations that do not fit the CLI model. Normally relevant only in assemblies that are mixed-mode, containing

Hololens Build Failing - The command AssemblyConverter.exe exited with code 1

一世执手 提交于 2019-12-01 17:14:48
问题 After updating to the latest version of VS 2017 (version 15.3.2) my Hololens builds generated from Unity keep failing with this message : The command ""C:\TestFile\HoloBuild\VSApp\Unity\Tools\AssemblyConverter.exe" -platform=uap -lock="C:\TestFile\HoloBuild\VSApp\HoloBuild\project.lock.json" -bits=32 -configuration=Debug -removeDebuggableAttribute=False -uwpsdk=10.0.15063.0 -path="." -path="C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\dotnet\x86\Debug" "C: