assemblies

Good way to preload .NET assembly

余生长醉 提交于 2019-12-03 10:52:26
问题 In my app I need to show a form on mouse click. The problem is that the form is in another assembly and because of lazy nature of assembly loading it is likely that the assembly isn't loaded yet when the mouse button is pressed. So what I have is very noticeable pause before the form finally appears. I was able to come up with a dumb fix by calling new FormFromAnotherAssembly() in my initialization method. That, of course, took care of things and the pause is no longer there, but it's very

How to get all types in a referenced assembly?

跟風遠走 提交于 2019-12-03 10:23:10
For whatever reason, I can't seem to get the list of types in a referenced assembly. Not only that, I can't even seem to be able to get to this referenced assembly. I tried AppDomain.CurrentDomain.GetAssemblies() , but it only returns assemblies that have already been loaded into memory. I tried Assembly.GetExecutingAssembly().GetReferencedAssemblies() , but this just returns mscorlib. What am I missing? Note that Assembly.GetReferencedAssemblies only includes a particular assembly if you actually use a type in that assembly in your assembly (or a type that you use depends on a type in that

What is the best way to use assembly versioning attributes?

断了今生、忘了曾经 提交于 2019-12-03 10:03:54
问题 The AssemblyVersion and AssemblyFileVersion attributes are the built-in way of handling version numbers for .NET assemblies. While the framework provides the ability to have the least significant parts of a version number (build and revision, in Microsoft terms) automatically determined, I find the method for this pretty weak, and no doubt have many others. So I'd like to ask, what ways have been determined to do the best job of having version numbers that better reflect the actual version of

Generate .NET Assemblies from Iron Python

做~自己de王妃 提交于 2019-12-03 08:43:45
问题 I have a Iron Python script that I want to run and then have the ipy interpreter output an assembly that I can run on other machines. How do I do that? Is there a switch I can pass to ipy.exe? 回答1: There is a tool that ships with IronPython called Pyc or the Python Command-Line Compiler. If you installed the latest version 2.6 of IronPython, then pyc.py will be available at C:\Program Files (x86)\IronPython 2.6\Tools\Scripts or wherever you installed IronPython on your system. If you have

GAC Assembly Missing in Add Reference dialog

女生的网名这么多〃 提交于 2019-12-03 08:07:56
I have an Interop assembly lying in GAC; Windows Explorer clearly shows it listed in the C:\WINDOWS\assembly folder. Yet, when I try to add a reference to it in from Visual Studio, I can't see it anywhere in the Add Reference dialog. If this is happened to you too, what is the reason for this? And how do I fix this? (The assembly is actually located in C:\WINDOWS\assembly\GAC_MSIL folder, if you must know.) Add one of the following registry keys, where is the directory to search, and MyAssemblies is the category of your assemblies. Note HKCU is for the current user and HKLM is for everyone on

Reference unmanaged assembly

白昼怎懂夜的黑 提交于 2019-12-03 06:31:30
I'm trying to reference a managed DLL in my .NET project, without copying it into my output directory. So, when my program runs, it runs the DLL from the location it's installed - wherever that is. The problem lies in the fact that this managed DLL calls unmanaged DLLs. When I try and reference the managed DLL, it throws a FileNotFound Exception - Could not load file or assembly 'CharacterGen' or one of its dependencies. The system cannot find file specified . When I set my output to be within the same directory as the DLL I'm referencing, everything works fine. The usual solution would be to

Error: Reference to type claims it is defined, but it could not be found

我是研究僧i 提交于 2019-12-03 06:29:09
问题 I have a solution with 3 projects: ParsersBase, that define an interface IParseRule ParsersLibrary, that have a reference to ParsersBase and define a class HtmlImageUrlParseRule : IParseRule ParsersLibraryTest, that have a reference to ParsersBase and ParsersLibrary and define a test class with some test methods When I'm trying to build it, I get a warning: Reference to type 'AVSoft.ParsersBase.IParseRule' claims it is defined in 'c:\Users\Tim\Dropbox\projects\Image Downloader\ParsersLibrary

Creating C# Type from full name

落花浮王杯 提交于 2019-12-03 06:08:33
I'm trying to get a Type object from type full name i'm doing the folowing: Assembly asm = Assembly.GetEntryAssembly(); string toNativeTypeName="any type full name"; Type t = asm.GetType(toNativeTypeName); I get null, why? the assembly is my executable (.net executable) and the type name is: System.Xml.XmlNode Well, if that really is the type's full name (i.e. including namespace) and it's in that assembly, then it should work. Could you give an example where it doesn't? As you're using Assembly.GetType rather than Type.GetType you shouldn't include the assembly name in the type name. Note

404 on Controllers in External Assemblies

做~自己de王妃 提交于 2019-12-03 05:11:18
问题 I am having trouble resolving 404 responses in my Asp.Net MVC 4 project. It's built in VS2012 targeting 4.5. I have pre-compiled views and controllers built into stand-alone DLLs. I am able to dynamically load the DLLs and inspect them from my core project, even invoke methods on them; however, it seems that the MVC Framework is not aware of the controllers. I am close here, but there is something missing. Background on the Controllers and Views Controllers are built in a stand-alone MVC

Maven: How to create assembly with snapshot artifacts without timestamps file name?

ε祈祈猫儿з 提交于 2019-12-03 04:44:26
问题 I've a repository containing snapshot artifacts with timestamps. I want to create an assembly, that contains the dependencies. This works fine. But the artifact names contains the timestamp. So i wonder how to remove the timestamp from filename for the assembly only. I've used this dependencySet : <outputFileNameMapping>${artifact.artifactId}-${artifact.version}.${artifact.extension}</outputFileNameMapping> But version seams to contain already the timestamp. So is there any chance to get a 1