assemblies

Error with existing COM Reference or adding a new one

北战南征 提交于 2019-12-05 17:53:24
Let me preface this by saying that I am unfamiliar with COM references, and I am using VS2010 on a Windows 7 64 bit machine. This morning I pulled down an existing project from TFS. I then tried to build the project and received this error: The type or namespace name 'validatecom' could not be found (are you missing a using directive or an assembly reference?) And I get this warning: Cannot get the file path for type library "d0b51ccc-aa31-47a1-b3ff-b8ed71c522a1" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)) When I check the references,

Is it possible to use Assembly.ReflectionOnlyLoad together with publisher policies / assembly versioning?

情到浓时终转凉″ 提交于 2019-12-05 17:51:48
My target: We are allowing to integrate our product with third party components (libraries) which are not installed as part of our product because of licensing. At the moment we want to load features related to third party components only if these components are installed on the client's machine. Current solution: I'm using Assembly.ReflectionOnlyLoad with providing full names of third party assemblies to validate installation of third party components before the application loads related features. This works for following scenarios: Exact versions of libraries are installed to GAC Exact

Pass a C++/CLI wrapper of a native type to another C++/CLI assembly

空扰寡人 提交于 2019-12-05 17:11:46
Suppose I have the following simple wrapper of a NativeClassInstance. public ref class Wrapper { private: NativeClass *_wrapped; public: Renderer() { _wrapped = new NativeClass(); } ~Renderer() { delete _wrapped; } operator NativeClass*() { return _wrapped; } } Now, I want to create an instance of Wrapper from C# with Wrapper wrapper = new Wrapper() and use it in another native functionalities wrapper that resides in another assembly with Helper.Foo(wrapper) (nothing strange having other functionalities not directly related to the wrapped classes in another assembly, IMO): // Utilities is in

When does .net check for assembly dependencies?

前提是你 提交于 2019-12-05 16:23:39
While pursuing a spearate problem I've come to a very peculiar situation. A demo code would be: public class Global : HttpApplication { protected void Application_Start(object sender, EventArgs e) { Log("In Application_Start"); SomeClass.SomeProp = ConfigurationManager.AppSettings["PropValue"]; } protected void Application_BeginRequest(object sender, EventArgs e) { Log("In Application_BeginRequest"); try { this.Application_Start(null, null); } catch ( Exception ex ) { Log(ex.ToString()); } Log("At the end of Application_BeginRequest"); } } What I get in my log is: In Application_BeginRequest

When does the CLR load an assembly in a .NET process?

回眸只為那壹抹淺笑 提交于 2019-12-05 14:19:12
Is a .NET assembly loaded by the CLR when a class from the assembly is referenced? Or When a class which declares the using namespace from the assembly is loaded? Also having loaded an assembly, does it ever unloads the assembly if it is not used for a long time? It's the JIT compiler that instructs the CLR to load an assembly once it has translated it to machine code which is done on demand and the exact time is not deterministic. As to the second question, once an assembly is loaded into the AppDomain, the only way to unload it is to destroy this AppDomain, there's no other way to unload an

Entity Container and Model generation in different assemblies

亡梦爱人 提交于 2019-12-05 14:12:34
I'm doing some refactoring and am trying to reuse my genertated entity models. My application has a few assemblies, one being my outward facing public types (API) and one containing implementations of providers (such as the log). I'd like to split the generation of the entities and models so that the entities will be in the API assembly and the container will be in the implementation assembly. Is this possible? Is possible. This is how I did it. Assembly A Database.EDMX Models.TT Models.cs Assembly B Database.EDMX ( Added as a Link to the real file in Assembly A ) EntityContainer.TT

put build date in about box

瘦欲@ 提交于 2019-12-05 13:54:05
I have a C# WinForms app with an About box. I am putting the version number in the about box using: FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location) .FileVersion This ends up giving me the Subversion revision number from which the executable was built. I would also like to get the date of the build into the About box. I tried: File.GetLastWriteTime(Assembly.GetEntryAssembly().Location) But that gives me the write date of the executable, which only corresponds to the date when the app was installed (we are using ClickOnce) not built . How can I get the build date ? If

how to add arbitrary information in manifest from maven assembly plugin

こ雲淡風輕ζ 提交于 2019-12-05 12:11:11
问题 i use the assembly plugin to create a uber jar from several maven artifacts. Now I like to add some company specific entries into the Manifest of the created assembly jar. But how ? the archive element doesnt allow arbitrary elements (or is there a way to add foobar: tutu inside the archive tag ?) also in addition with maven-jar-plugin it does not work as this only affects the default artifact of the project and not the assembled. Any idea how to do this ? 回答1: argh... after posting it i

Resolving/using multiple assembly versions from 3rd party dependencies

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 11:41:30
In my project, I have a problem with its dependency hierarchy. I use a library ( WriteableBitmapExtensions ) in my code, and I have another 3rd party library which also uses WriteableBitmapExtensions. Only the other library is strongly tied to a specific, older version, and my code needs the functionality in its latest version. Here's a depiction of the dependencies: There are similar questions & solutions but they resolve it with assembly binding at runtime via a config file, but I don't think this is compatible for a Silverlight application. Referencing 2 different versions of log4net in the

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

Deadly 提交于 2019-12-05 11:39:34
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? 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 directory for code to work.) However, if you want to create a truly pluggable interface, I suggest you use an