Consider the following code: private static void Main(string[] args) { var exe = new MemoryStream(File.ReadAllBytes(args[0])); var assembly = AssemblyLoadContext.Default.LoadFromStream(exe); assembly.EntryPoint.Invoke(null, new object[] { new string[
I'm not very familiar with VS. I have inherited a set of VS projects and I can run the one I'm currently interested in within Visual Studio. But, when I take the generated .exe file and try to run it from the cmd line, I get an error: Unhandled Excep
I have developed a SharePoint provider hosted (MVC) app and hosted web application in iis of azure VM (WIN SERVER 2012). When we try to use application using an app, It throws below error. Server Error in '/' Application. Could not load file or assem
I could not find a way of creating a class object from given type and assembly definition using reflection. For my case, I have a string containing class and assembly name and need to create the object: string str = "My.Assembly.Namesapce.MyClass, My
We try to compile source code at runtime and then add the resulting assembly to an AppDomain. But in the moment even loading the assembly fails: string sourceCode = "using System;\r\n" + "public class Program1{\r\n" + " public sta
I am trying to make a windows form to be reused across several projects. So I thought this would be a class library. What I want to do is call WindowsForm.Show() as a static call. I've tried to create a class library but I cannot reach the resources
I have following setup in a MEF application: Assembly MyBaseAssembly: namespace My.Namespace { [DataContract] public class Container { [DataMember] public Data Item { get; set; } } [DataContract] public class Data { [DataMember] public string Foo { g
I know that I can open a DLL file with an assembly browser, such as ILSpy, to see the classes and methods that it contains. But if a process is currently using a DLL, is it possible to know what method it is currently using? And any other details, su
I have c# application and when I made a change, I am getting the error message: An unhandled exception of type 'System.TypeLoadException' occurred in WindowsFormsApplication1.exe Additional information: Could not load type 'TradeIdeas.TIProData.OddsM
I have a namespace called MyNamespace.Demo1, one static class called STClass and one property inside that class called prpAssm. How do I get the data-type of property prpAssm? Type classType = typeof(STClass); PropertyInfo propertyInfo = classType.Ge
I am using NUnit to test one functionality where I need to load XML file to object. The XML file is in location of the Console Application. I have Following method where configuration will be read : public string GetConfiguration(TempFlexProcessor pr
We have an MVC UI that will generically draw itself based on data types it gets from the WebAPI. On App start of the ui I call into my WebApi to pull the "LeadTypes" down in a list of Assemblies List using binary formatter to serialize and deser
I'm on CRM 4.0 and I get the following error when I try to execute retrieval of multiple entities. Could not load file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system
I want to use the Bitmap class under an XNA project declared on System.Drawing but it says that I'm missing an assembly or reference. I added System.Drawing to my references and changed my target framework after seeing this post. I opened 3 or 4 new
I have solution and my class in it. Then i add another project at my solution. So, i want to use another class B and its methods,field from my class A. Class B looks like: class B { public int field1; public int field2; public void Test() {} } How to
So I have some users getting this error System.MissingMethodException: Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation(System.String, System.Collections.Generic.IEnumerable`1<System.String>)'. at System.Net.Http.Http
We are developing a web application which has tons of plugin dll files. Now, we are able to load all the assemblies we need but we are using BuildManager.AddReferencedAssembly while doing this. Which - I guess - causes a little problem. The problem i
I've been searching for a while but I did not find any suitable answer to this question. I noticed that my antivirus started detecting my application as a trojan. My antivirus is Kaspersky 2013 and this is the type of trojan it has detected. http://w
On Windows, I have a C# assembly that is COM visible. It references other assemblies to control an application in the machine. It works fine. However, under Apache Web Server and using CGI, it doesn't work. After doing some debuging, I found out that
I have a huge .Net library with a few hundred classes in them. However, i only use a subset of this library. So i would like to create a new assembly only with the required and dependant classes instead of using the whole thing. Is there a quick, fre
Tl;dr version: I am stuck with the exception: System.IO.FileLoadException : Could not load file or assembly 'DotNetOpenAuth.AspNet, Version 4.0.0.0 ... A bit dismayed that msft used so many static classes and methods for auth in the new MVC4 project
I am considering using a character with a diacritical mark (e.g., ō) in a namespace for a custom framework. This idea has come up as a way to distinguish a product, but I want to to be sure this isn't a bad idea, and if there is anything about it tha
Yesterday my project was running smoothly but today I'm facing an error. Here are the details: Could not load file or assembly 'file:///C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\parktms\c8392404\1ba3bab5\App_Web_login.aspx
I have a web project like: namespace Web { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { lbResult.Text = PathTest.GetBasePath(); } } } The method PathTest.GetBasePath() is defined in anoth
I would like to know how to pragmatically get the name of the running file not the assembly name but the name of the file in C# .NET, I tried System.Reflection.Assembly.GetEntryAssembly().GetName().Name this gives the name of the assembly but i am lo
I've read about this technique: http://blogs.msdn.com/b/jjameson/archive/2009/04/03/shared-assembly-info-in-visual-studio-projects.aspx Basically it means to create a SharedAssemblyInfo.cs with versioning information about the assembly, and adding th
I finally decided myself to post my problem, after a couple of hours spent searching the Internet for solutions and trying some. [Problem Context] I am developing an application which will be deployed in two parts: an XML Importer tool: its role is t
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 cod
Can I just use?: Assembly.LoadFile Not sure if this is the way to do this? But when I try that approach, it throws a Could not load file or assembly "CustomControlLib" or one of its dependencies. The system cannot find the file specified. Any id
I'm trying to export a control library in a .dll for other developers in the office to consume. The solution I original created looks like this: Solution 1: - Mri.Controls (Class Library) - Mri.FmTool (Web Application) Mri.FmTool references Mri.Contr