assemblies

Is there a way to specify assembly references based on build configuration in Visual Studio?

久未见 提交于 2019-11-28 04:04:27
I have a project that adds some extensibility to another application through their API. However, I want to be able to use the same project for multiple versions of their application, because most of the code is the same. However, each version of the application requires a reference to the proper assembly for that version of the software. They load their assemblies into the GAC, so even if I could specify the version of the assembly to use based on build configuration I would be fine. Is there a way to do this from inside of VS or do I need an external build tool? There is a way to do this, but

Reference two equal assemblies, only public keys differ

荒凉一梦 提交于 2019-11-28 03:43:21
问题 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

Difference Between Assembly and DLL

为君一笑 提交于 2019-11-28 03:40:24
What is the difference between Assembly and a DLL? While sending the code to a remote client, should a DLL file be sent or should a Assembly be sent (When direct TCP connection is available between two)? An assembly is .NET's "minimum unit of deployment". Usually an assembly corresponds to a single file, but it doesn't have to - you can have multiple files, with one of them being the master which knows where all the other bits are. Single-file assemblies are usually DLLs or EXE files. If you've got a normal class library and you just want to send it to the other side, the DLL is what you want.

Load WPF styles or other Static Resources from an external file or assembly

夙愿已清 提交于 2019-11-28 03:22:41
I have a few WPF applications and I want all my styles to be in a shared assembly instead of declaring them in each application separately. I am looking for a way so I don't have to change all my Style="{StaticResource BlahBlah}" in the existing applications; I just want to add the reference to this style assembly, and delete it from the current application, so it's taken from the assembly. Is there any way? Shimmy Referencing an external ResourceDictionary (XAML File): <Application.Resources> <ResourceDictionary Source="MyResources.xaml" /> </Application.Resources> Referencing an external

What is a satellite assembly?

扶醉桌前 提交于 2019-11-28 03:17:39
问题 What is a satellite assembly, and how can we use it? 回答1: 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

How to pre-load all deployed assemblies for an AppDomain

╄→尐↘猪︶ㄣ 提交于 2019-11-28 03:16:14
UPDATE: I now have a solution I'm much happier with that, whilst not solving all the problems I ask about, it does leave the way clear to do so. I've updated my own answer to reflect this. Original Question Given an App Domain, there are many different locations that Fusion (the .Net assembly loader) will probe for a given assembly. Obviously, we take this functionality for granted and, since the probing appears to be embedded within the .Net runtime ( Assembly._nLoad internal method seems to be the entry-point when Reflect-Loading - and I assume that implicit loading is probably covered by

InvalidCastException for two Objects of the same type

纵然是瞬间 提交于 2019-11-28 02:33:10
问题 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

How to find out if a .NET assembly was compiled with the TRACE or DEBUG flag

筅森魡賤 提交于 2019-11-28 01:52:02
Is there any way to find out if an assembly has been compiled with the TRACE or DEBUG flag set without modifying the assembly? this. __curious_geek The only best way to do is check the compiled assemblies itself. There is this very useful tool called '.NET Assembly Information' found here by Rotem Bloom. After you install this it asociates .dll files to open with itself. After installing you can just double-click on the Assembly to open with it and it will give you the assembly details as displayed in the screenshop below. There you can identify if it's debug compiled or not. alt text http:/

Do I need to publish the public key from .snk file?

ⅰ亾dé卋堺 提交于 2019-11-28 01:20:42
From the description of sn.exe utility and this question I see that a copy of the public key is added to every assembly signed with the strong name. This is enough to validate that the assembly binary has not been altered. But how does one verify that given assembly was really signed with some given keypair and compiled by a given company? Anyone could generate his own keypair, produce some assembly and sign it with his keypair. Do I need to publish the public key so that those who want to verify the assembly origin could compare the public keys? if so, what is the best way to do so? No, you

How can I merge resource files in a Maven assembly?

℡╲_俬逩灬. 提交于 2019-11-28 00:48:38
I'm using Maven and its assembly plugin to build a distribution package of my project like this: one project assembles a basic runtime (based on Felix), with the appropriate directories and bundles, in a ZIP file. third-party libraries are collected in one project each and either converted to OSGi bundles or, if they are already OSGi compatible, they are just copied my own project consists of several modules that are built into OSGi bundles, too. Now, I'm adding another project that unpacks the ZIP, drops all the other JARs into the proper directories, and repackages it for distribution. Now,