assemblies

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

我只是一个虾纸丫 提交于 2019-11-29 12:21:25
问题 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

Mixed mode assembly is built against version X and cannot be loaded in version Y of the runtime without additional configuration information

℡╲_俬逩灬. 提交于 2019-11-29 10:56:37
After doing some code refactoring, my VS2010 VB.Net Web Application project has stopped compiling with the following error: "Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information." In the 'File' column of the Visual Studio's error list is the word 'SGEN', but when I double-click, the file does not exist ("The document cannot be opened. It has been renamed, deleted or moved.") I gather it has something to do with serialization, but what is the required additional configuration information? I

Getting runtime version of a Silverlight assembly

本小妞迷上赌 提交于 2019-11-29 10:53:42
问题 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? 回答1: private static Version ParseVersionNumber(Assembly assembly) { AssemblyName assemblyName = new AssemblyName(assembly.FullName); return assemblyName.Version; } or this: Assembly assembly = Assembly

Reference two equal assemblies, only public keys differ

╄→гoц情女王★ 提交于 2019-11-29 10:45:44
My Visual Studio 2008 project references two (external) assemblies (A+B) both of which happen to be referencing the same third assembly (C). However, assembly A expects assembly C to have a public key which is different from what assembly B expects it to have. Here's an example of the obvious exception: Could not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=9ad232b50c3e6444' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Ofcourse, I would not be able

Error reading assemblies: No assembly descriptors found

半世苍凉 提交于 2019-11-29 10:41:04
问题 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> <

Can NInject load modules/assemblies on demand?

让人想犯罪 __ 提交于 2019-11-29 10:35:17
问题 Are there facilities in NInject that will allow me to load services from other modules (assemblies) on demand like it's done in Unity? 回答1: I'm pretty sure this is what you're looking for: var kernel = new StandardKernel(); kernel.Load( Assembly.Load("yourpath_to_assembly.dll"); If you look at KernelBase with reflector in Ninject.dll you will see that this call will recursively load all modules in the loaded assemblies (Load method takes an IEnumerable) public void Load(IEnumerable<Assembly>

C# Using Assembly to call a method within a DLL

≯℡__Kan透↙ 提交于 2019-11-29 10:19:34
问题 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

What is a satellite assembly?

ε祈祈猫儿з 提交于 2019-11-29 09:57:02
What is a satellite assembly, and how can we use it? Satellite assemblies are small assemblies that contain only resources and are specific to a particular language (or, more accurately, culture). For instance, say I have an assembly called "MyAssembly.dll". If I had translations for US English and Chinese (PRC), the file structure would look like this: MyAssembly.dll en-US/ MyAssembly.resources.dll zh-CN/ MyAssembly.resources.dll Each of the .resources.dll files would contain the data from any culture-specific resource files that would be in the project (they would take the form of FileName

InvalidCastException for two Objects of the same type

六眼飞鱼酱① 提交于 2019-11-29 09:09:43
I have this weird problem that I cannot handle myself. A class in the model of my mvp-project designed as singleton causes an InvalidCastException. The source of error is found in this code line where the deserialised object is assigned to the instance variable of the class: engineObject = (ENGINE)xSerializer.Deserialize(str); It occurs whenever I try to add one of my UserControls to a Form or to a different UC. All of my UCs have a special presenter that access the above mentioned instance variable of the singleton class. This is what I get when trying to add a UC somewhere: 'System

How does the number of classes in an assembly impact performance?

心不动则不痛 提交于 2019-11-29 08:34:45
The project I'm working on will generate code for a large number of classes - hundreds to thousands is expected. It is not known at generation time how many of these classes will actually be accessed. The generated classes could (1) all live in a single assembly (or possibly a handful of assemblies), which would be loaded when toe consuming process starts. ...or (2) I could generate a single assembly for each class, much like Java compiles every class to a single *.class binary file, and then come up with a mechanism to load the assemblies on demand. The question: which case would yield better