.net-assembly

Entry point not found in assembly

末鹿安然 提交于 2019-12-12 04:28:50
问题 I have a Application where I need to create AppDomain and Load Assembly into it and execute the methods in the Assembly. Here is my Code public class CreateAppDomain { public void CreateAppDom() { AppDomain domain = AppDomain.CreateDomain("myDomain"); domain.ExecuteAssembly(@"C:\Visual Studio 2005\Projects\A1\A1\bin\Debug\A1.dll"); domain.CreateInstanceFrom(@"C:\Visual Studio 2005\Projects\A1\A1\bin\Debug\A1.dll","A1.Navigate"); } } I above code is written in a classfile called

Package signing , and digital certificate

假装没事ソ 提交于 2019-12-12 04:04:50
问题 I Created a windows forms application using c# the output of the App is .exe , in the references of this project , I had added a reference of many dlls that this project needs all of them are Created by me.But these referenced dlls , some of them are using third parities Dll. I packed the .exe and all referenced dll in an installer project using wix Toolset. Note that the .exe and the installer has no strong names and not signed with key. I upload this .msi result file into an intranet server

Calling Custom Assembly Attributes

◇◆丶佛笑我妖孽 提交于 2019-12-12 03:54:49
问题 I have created a custom attribute and use it in the AssemblyInfo.vb file. The attribute is declared in another file like so: Public NotInheritable Class AssemblyBuildNameAttribute Inherits Attribute Private _p1 As String Sub New(p1 As String) ' TODO: Complete member initialization _p1 = p1 End Sub End Class And is in the AssemblyInfo.vb file like so: <Assembly: AssemblyVersion("0.4.15")> <Assembly: AssemblyFileVersion("13.10.1.8")> <Assembly: AssemblyBuildName("alpha")> How can I call this

.NET Framework get running processor architecture

淺唱寂寞╮ 提交于 2019-12-12 03:42:03
问题 There is an enum of all supported processor architectures here: http://msdn.microsoft.com/en-us/library/system.reflection.processorarchitecture.aspx Is there any way to determine which one corresponds to the running environment? System.Reflection.Assembly.GetExecutingAssembly().ProcessorArchitecture returns MSIL -- obviously wrong. EDIT: Bojan Resnik posted an answer and deleted it. I see that some clarification is needed from the partial trace I got. The assembly needs to run on multiple

C# Load Assembly w/ Common References

六眼飞鱼酱① 提交于 2019-12-12 02:55:43
问题 I've run into a slight issue - I'm writing a program that loads DLLs, each of which contain a class which inherits from a class existing in a library referenced by both the loaded DLL and the "host" program that is loading the DLL. The issue here is that, when I try to load and cast to the superclass: var assembly = Assembly.LoadFrom(dllPath); var type = assembly.GetTypes().FirstOrDefault(x => x.IsSubclassOf(typeof (MySuperclass))); ... Although both are referencing the class containing

Use assembly class without the assembly object

前提是你 提交于 2019-12-12 02:18:32
问题 I currently load C# code which I have compiled into a DLL using the Assembly class: private void LoadAssembly() { try { Assembly loadedAssembly = Assembly.LoadFrom("E:/MyUtilities/bin/Debug/MyUtilities.dll"); System.Type type = loadedAssembly.GetType("DLLTest.MyUtilities"); FieldInfo field = type.GetField("c"); Debug.Log(field.GetValue(null)); } catch (System.Exception e) { Debug.Log( e.ToString() ); } } This is in a Unity game. It works fine. But I want to load the class into the loading

Can't add assemble reference to project

时光毁灭记忆、已成空白 提交于 2019-12-12 01:13:28
问题 I have a web site on Framework 4.5.1. When I compile I have a missing assembly reference error for System.Data.DataExtensions. So I go to add a reference tick the box close the dialog , recompile. Same assembly is missing again. Go back to references and the assembly is no longer ticked. It does add it the the web.config but the reference always disappears. I came across this link similar issue but the solution was only having using System.Data instead of using System.Data.DataExtensions. But

How to call an instance class method from a static method with reflection

亡梦爱人 提交于 2019-12-12 00:49:21
问题 namespace ClassLibraryB { public class Class1 { public void Add(int ii, int jj) { i = ii; j = jj; result = i + j; } public void Add2() { result = i + j; } } } This gets called statically and gives me an answer ClassLibraryB.Class1 objB = new ClassLibraryB.Class1(); objB.Add(4, 16); objB.Add2(); kk = objB.result; textBox1.Text += "Addition =" + kk.ToString() + "\r\n"; However when I try to call the dll using below it fails with since it is not static Assembly testAssembly = Assembly.LoadFile

Assembly has a higher version than referenced. EPI5 to EPI6

和自甴很熟 提交于 2019-12-11 23:41:45
问题 After a succesfull uppgrade from EPi5 to EPi6 i get this error Error 101 Assembly 'EPiServer.Web.WebControls, Version=6.0.530.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' uses 'EPiServer, Version=6.0.530.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' which has a higher version than referenced assembly 'EPiServer, Version=5.2.375.236, Culture=neutral, PublicKeyToken=8fe83dea738b45b7' c:\EPiServer\Sites\UppgraderaSiteName\SiteName.Web\bin\EPiServer.Web.WebControls.dll SiteName.Web

WPF - Use different Versions of DLLs with UserControls

孤者浪人 提交于 2019-12-11 20:28:52
问题 I have the Problem, when I have WPF UserControls and I have the DLL where this UserControl is located in different Versions loaded into the Assembly, the UserControl could not find it's Resources any more. (Maybe because they are there with the same Name but in different Versioned DLLs) Any know how to fix it? 回答1: I found a way myself, by changeing the "IntializeComponent" Method in the DLL. This Builds a URI, wich then loades the XAML. The Problem is, in the URI, the Version is not included