assemblies

Loading an assembly generated by the Roslyn compiler

我的梦境 提交于 2019-11-30 09:50:24
I'm generating a Greeter.dll using the Roslyn compiler. My problem occurs trying to load the DLL file. Here's the code: using System; using Roslyn.Compilers; using Roslyn.Compilers.CSharp; using System.IO; using System.Reflection; using System.Linq; namespace LoadingAClass { class Program { static void Main(string[] args) { var syntaxTree = SyntaxTree.ParseCompilationUnit(@" class Greeter { static void Greet() { Console.WriteLine(""Hello, World""); } }"); var compilation = Compilation.Create("Greeter.dll", syntaxTrees: new[] { syntaxTree }, references: new[] { new AssemblyFileReference(typeof

FileNotFoundException for mscorlib.XmlSerializers.DLL, which doesn't exist

馋奶兔 提交于 2019-11-30 08:48:07
I'm using an XmlSerializer to deserialize a particular type in mscorelib.dll XmlSerializer ser = new XmlSerializer( typeof( [.Net type in System] ) ); return ([.Net type in System]) ser.Deserialize( new StringReader( xmlValue ) ); This throws a caught FileNotFoundException when the assembly is loaded: "Could not load file or assembly 'mscorlib.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified." FusionLog: === Pre-bind state information === LOG: User = ### LOG: DisplayName = mscorlib

What install files in location - Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5

霸气de小男生 提交于 2019-11-30 08:10:14
问题 Please bear with me on this, I will try to explain as clearly as I can. I started a new project (class library) which targets 4.5 and not the client profile 4.5. I added a reference "System.Runtime.Serialization" and the properties indicates it's in location "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Runtime.Serialization.dll" On my pc it compiles fine with a build script using msbuild. On the buildserver which uses team city - it complains error

Getting runtime version of a Silverlight assembly

隐身守侯 提交于 2019-11-30 07:59:51
I want to show my Silverlight 3 application's version number in the about box, but when I use a traditional .Net call like: Assembly.GetExecutingAssembly().GetName().Version; I get a MethodAccessException on the GetName() call. How am I supposed to get the version number of my assembly? James Campbell private static Version ParseVersionNumber(Assembly assembly) { AssemblyName assemblyName = new AssemblyName(assembly.FullName); return assemblyName.Version; } or this: Assembly assembly = Assembly.GetExecutingAssembly(); String version = assembly.FullName.Split(',')[1]; String fullversion =

Error reading assemblies: No assembly descriptors found

≯℡__Kan透↙ 提交于 2019-11-30 07:55:52
I get Error reading assemblies: No assembly descriptors found when building my project. I'm trying to set permissions for my .sh files and exclude a nasty .jar file that makes my application crash...I don't think the problem is about that though.... My maven-assembly plugin is added like this in my pom.xml file: <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <descriptors> <descriptor>src/main/assembly/src.xml</descriptor> </descriptors> <

Find out dependencies of all DLLs?

巧了我就是萌 提交于 2019-11-30 07:50:23
I have a collection of DLLs(say 20). How do I find out all the DLLs on which one specific DLL (say DLL A) is depending upon? If you mean programmatically, use Assembly.GetReferencedAssemblies . You can use that recursively to find all the assemblies you need. (So you find the dependencies of X, then the dependencies of the dependencies, etc.) Since the question is tagged "C#", I would assume you are talking about managed dlls (assemblies). In that case, dependencywalker is not useful. If you want to do that with a program, good ones are dotPeek by JetBrians and Reflector by RedGate. Or you can

C# Using Assembly to call a method within a DLL

折月煮酒 提交于 2019-11-30 07:38:41
I have been reading a lot about this - I feel like I'm very close to the answer. I am simply looking to call a method from within a dll file that I have created. For example purposes: My DLL File: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ExampleDLL { class Program { static void Main(string[] args) { System.Windows.Forms.MessageBox.Show(args[0]); } public void myVoid(string foo) { System.Windows.Forms.MessageBox.Show(foo); } } } My Application: string filename = @"C:\Test.dll"; Assembly SampleAssembly; SampleAssembly = Assembly.LoadFrom

Assembly names and versions

北战南征 提交于 2019-11-30 07:16:24
问题 What is considered as best practice when it comes to assemblies and releases? I would like to be able to reference multiple versions of the same library - solution contains multiple projects that depend on different versions of a commonutils.dll library we build ourselves. As all dependencies are copied to the bin/debug or bin/release, only a single copy of commonutils.dll can exist there despite each of the DLL files having different assembly version numbers. Should I include version numbers

Is this DLL managed or unmanaged?

▼魔方 西西 提交于 2019-11-30 06:55:33
问题 I hold before you a DLL. Using only the Win32 SDK, can you tell me if this DLL is a .NET assembly? Why? Our application loads plugins in the form of DLLs. We are trying to extend the definition of these plugins to allow for .NET assemblies but the interface will be different and thus the loader will need to know if the DLL is managed or unmanaged before loading it. 回答1: You can check the PE header information for the information about what type of information is contained in the DLL. This

“Are you missing an assembly reference?” compile error - Visual Studio

风格不统一 提交于 2019-11-30 06:51:48
问题 I am currently working on a server control for other applications in our company to interface with a WCF service. Every time I make a change code change and recompile the control, I increment the the AssemblyVerison and AssemblyFileVersion class in the AsseemblyInfo.cs by one. For example, my latest build went from 1.0.07.0 to 1.0.08.0. When the consuming application updates the file by copying the latest file in the bin directory and tries to compile, they receive the following error: The