assemblies

Loading an Assembly fails because of incorrect format

↘锁芯ラ 提交于 2020-01-02 05:41:13
问题 I develop on a pretty big windows forms .net (C#) application with several assemblys. Originally each assembly was build for the Target Platfom "Any CPU". Due to a problem with Crystal Reports on x64 machines we had to build the whole project for x86 target platform. I startet rebuilding some of our Projects for x86 and it worked just fine. But with one I have the problem that when I try to use it as a reference in another Assembly, the other one won't load it giving following Error: Could

Downgrade (use a lower-versioned library) with a binding redirect

北战南征 提交于 2020-01-02 05:01:09
问题 I'm using an older version of NHibernate (v3.0.0.1001) and I'm stuck to it because the new LINQ provider breaks quite a few of my queries (something I'll be trying to fix later). I want to update a library that uses NHibernate v3.1.0.4000. I've tried adding a binding redirect in the App.config: <?xml version="1.0"?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4"

How can I pass an argument to a C# plug-in being loaded through Assembly.CreateInstance?

大憨熊 提交于 2020-01-02 04:12:09
问题 What I have now (which successfully loads the plug-in) is this: Assembly myDLL = Assembly.LoadFrom("my.dll"); IMyClass myPluginObject = myDLL.CreateInstance("MyCorp.IMyClass") as IMyClass; This only works for a class that has a constructor with no arguments. How do I pass in an argument to a constructor? 回答1: You cannot. Instead use Activator.CreateInstance as shown in the example below (note that the Client namespace is in one DLL and the Host in another. Both must be found in the same

ASP.NET - bin Directory vs. Adding Assembly in web.conf

爱⌒轻易说出口 提交于 2020-01-02 01:15:11
问题 I am relatively new to ASP.NET programming (but not programming in general), and I have been looking through a project that has been handed off to me. Within this project, there is a bin directory which contains a slew of various DLL files. Then, in the web.conf file, inside the assemblies structure (within the XML), there is a slew of other assemblies being added. I've done a search on both SO and through Google in general, and I am still struggling over what the difference is between the

Correct way to distribute VC++ runtime files

久未见 提交于 2020-01-01 09:21:29
问题 I have an MFC application which I am trying to package for deployment. It seems to depend on the files 'msvcr90.dll', 'msvcp90.dll' and 'mfc90.dll'. What is the correct way to distribute these files? I can't use merge modules as my installer doesn't support them. I know I can run VCRedist_x86.exe, but I don't want to do this for various reasons. As far as I can see my only alternative is to install the files as Private Side-by-Side assemblies. Is this correct? According to http://msdn

clr.sll!StrongNameSignatureVerification CPU consumption

两盒软妹~` 提交于 2020-01-01 09:09:09
问题 I have a C# (.NET 4.0) WinForm application that continuously communicates to a Linux based application, receives some data from it few times a second. I have been fine-tuning this WinForm application to reduce it's high CPU use when I saw ' clr.sll!StrongNameSignatureVerification ' is consuming a lot of CPU for this application. I used Process Explorer to find this out. Some Google searching told me that 'clr.sll!StrongNameSignatureVerification' is kicking-in because CLR is trying to verify

clr.sll!StrongNameSignatureVerification CPU consumption

a 夏天 提交于 2020-01-01 09:08:05
问题 I have a C# (.NET 4.0) WinForm application that continuously communicates to a Linux based application, receives some data from it few times a second. I have been fine-tuning this WinForm application to reduce it's high CPU use when I saw ' clr.sll!StrongNameSignatureVerification ' is consuming a lot of CPU for this application. I used Process Explorer to find this out. Some Google searching told me that 'clr.sll!StrongNameSignatureVerification' is kicking-in because CLR is trying to verify

Best practices for merging assemblies?

╄→尐↘猪︶ㄣ 提交于 2020-01-01 08:55:47
问题 I am wondering what are the heuristics when creating releases of libraries to be included in other projects in relation to dependencies and if I should include them or not. My problem is the following: I have a CommonUtilities library that provides as the name implies a set of utilities that can be used in more than one place. Dependencies of CommonUtilities include log4net.dll (the logging framework) and Oracle.DataAccess.dll (database driver). I have another project called MyProject that I

Signing my assembly with a strong name stops it from working

落花浮王杯 提交于 2020-01-01 08:21:20
问题 A colleague of mine created an assembly in VB.net for use with JScript via COM interop. The assembly used to work fine, but we signed it and now it only seems to work on Windows 7 machines. I've tested 2 Windows 7 machines and 2 Windows Vista machines. When we signed the assembly and we try to instantiate the ActiveX object in JScript, an error is returned with no message and only a number: Error: Error number: -2146234304 A search on Google for the error number didn't return much. If we

Signing my assembly with a strong name stops it from working

烂漫一生 提交于 2020-01-01 08:21:09
问题 A colleague of mine created an assembly in VB.net for use with JScript via COM interop. The assembly used to work fine, but we signed it and now it only seems to work on Windows 7 machines. I've tested 2 Windows 7 machines and 2 Windows Vista machines. When we signed the assembly and we try to instantiate the ActiveX object in JScript, an error is returned with no message and only a number: Error: Error number: -2146234304 A search on Google for the error number didn't return much. If we