assemblies

Cannot load assembly (hr = 0x80131018)

大兔子大兔子 提交于 2019-12-11 01:55:47
问题 I have a user with issues loading a .Net assembly into AutoCAD. I get the following error: Cannot load assembly. Error details: System.BadImageFormatException: Could not load file or assembly (hr = 0x80131018) They are using an anit virus package called Endpoint Security and when this is turned off, the load works. I am not a .Net expert and was hoping there might be a friendlier solution than me suggesting the user put their anti virus package in the trash!? But I've no idea where to start,

How to add types from external assembly to toolbox control? (WPF)

你说的曾经没有我的故事 提交于 2019-12-10 23:58:12
问题 I am trying to do something like this in my WPF application: ToolboxControl ctrl = new ToolboxControl(); Assembly assembly = Assembly.LoadFile(file); var category = new ToolboxCategory(assembly.GetName().Name); foreach (Type t in assembly.GetTypes()) { var wrapper = new ToolboxItemWrapper(t, t.Name); category.Add(wrapper); } ctrl.Categories.Add(category); i.e. adding ToolboxItemWrappers for each type found in an assembly. However the last line throws the following exception (see image) http:/

Strong Naming or Authenticode signing a new assembly

落爺英雄遲暮 提交于 2019-12-10 23:05:09
问题 I've been asked by an end user to add "Strong Naming" to one of my components, because they want to reference it from a strong named assembly. I already have an authenticode certificate, so I'm wondering - to make my component usable by their strong named component, is it enough for me to just sign the component with my authenticode key? Or do I have to "strong name sign" the assembly (using Al.exe) for it to be considered "Strong named"? I cannot find any "strong name vrs authenticode"

Complicated API issue with calling assemblies dynamically‏

那年仲夏 提交于 2019-12-10 22:27:42
问题 I have an interesting challenge that I'm wondering if anyone here can give me some direction. I'm writing a .Net windows forms application that runs on a network and uses an SQL Server to save and pull data. I want to offer a mini "plugin" API, where developers can build their own assemblies and implement a specific interface (IDataManipulate). These assemblies then can be used by my application to call the interface functions and do something. I can create assemblies using my API, copy the

Problem using ‘useLegacyV2RuntimeActivationPolicy’ & supportedRuntime in an application

浪子不回头ぞ 提交于 2019-12-10 21:52:18
问题 I've modified a couple of different applications' .config file like this: <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> </startup> When I did this for devenv.exe.config (VS 2005 - don't ask :) ), things work great - most of the Visual Studio used .NET 2.0 but I was able to make use of an assembly targeting .NET 4.0 framework. I tried to do the same thing for a custom .exe, which happens to be based on MS CAB (slightly modified) and has a hybrid mix of

Mono.Cecil: call base class' method from other assembly

泄露秘密 提交于 2019-12-10 21:49:28
问题 How can I get a MethodReference to a base class' method by name? I've tried type.BaseType.Resolve().Methods; and if I add the dll containing the base class to the assemblyresolver it returns the methods. But if I add a call using MSILWorker.Create(OpCodes.Call, baseMethod); (where baseMethod was found by foreaching Methods from the resolved TypeDefinition) the resulting IL is unreadable, even Reflector freezes and quits. Now some IL: if calling private method on type: call instance void

Wix - ComPlusAssembly - Could not install type library

China☆狼群 提交于 2019-12-10 20:52:34
问题 I'm new to Wix and I have ran into a problem that I'm obviously not able to solve on my own, so any help will be very much appreciated. Quick background: I'm representing a software vendor building a comprehensive suite of SOA based applications for deployment in large enterprises. Our architecture consists of many layers which may be installed/upgraded independently, so I'm building several installers, composing from the ground up (like: platform, core framework components, service layer,

Merge two assemblies at runtime - C#

强颜欢笑 提交于 2019-12-10 20:19:53
问题 Is it possible to merge two assemblies at runtime such that, when you iterate over the ExportedTypes, all the types from both original assemblies are returned? The why: I use a database migration framework to update my databases. It take a single assembly made up of special classes which defines the modifications made to the database. I have two databases the are very similar. Many tables are identical, but each has a couple of unique tables. I would like to have a general migration assembly

Dynamically load a DLL from a specific folder?

﹥>﹥吖頭↗ 提交于 2019-12-10 19:48:10
问题 At the moment, I have this code : var shellViewLibrary = Assembly.LoadFrom(Path.Combine(_DllsPath, _DllShellView)); IEnumerable<Type> types = shellViewLibrary.GetTypes(); foreach (Type type in types) { var typeIShellViewInterface = type.GetInterface(_NamespaceIShellView, false); if (typeIShellViewInterface != null) { //here } } The thing is that where I got //here I want to use Activator.CreateInstance to create an object whose type is type in a specific folder (that is outside the build

Why am i getting Stream as System.IO.UnmanagedMemoryStream?

杀马特。学长 韩版系。学妹 提交于 2019-12-10 19:09:56
问题 I have a part of code like this Assembly myAssembly = Assembly.GetExecutingAssembly(); string[] names = myAssembly.GetManifestResourceNames(); foreach (string file in names) { if (file.EndsWith(".dtd")) { // attach to stream to the resource in the manifest dtdStream = myAssembly.GetManifestResourceStream(file); MessageBox.Show(dtdStream.ToString()); } } i have all the dtd files under my Resources folder.Which has build type Embedded Resource. Now when i Debug the code i am getting a message