assemblies

Does order matter when registering, gac-ing assemblies for COM interop?

こ雲淡風輕ζ 提交于 2019-12-05 11:29:58
When registering .NET assemblies for COM Interop, I do two things, currently in this order: regasm /tlb:MyDll.tlb Mydll.dll gacutil /i Mydll.dll I use regasm to register the type library for COM and gacutil to install the assembly into the GAC. Does it matter which order I do these two actions? Also, as I make updates to my dll, do I need to un-register and re-register it, uninstall it from the gac and re-install it, both or neither? Does order matter? No. Do you need to reinstall in GAC when the dll has changed? Yes. Do you need to re-register for COM when dll has changed? That depends. If

Can't find Microsoft.SqlServer.ConnectionInfo.dll assembly file?

China☆狼群 提交于 2019-12-05 11:00:10
问题 I'm trying to dynamically get a databases Table structure using only C# code as follows: using Microsoft.SqlServer.Management.Common; using Microsoft.SqlServer.Management.Smo; public class LoadStuff { ... public void LoadDatabase(string vDatabaseName) { using (var vSqlConnection = new SqlConnection(DatabaseConnectionString)) { var vConnection = new ServerConnection(vSqlConnection); var vServer = new Server(vConnection); var vDatabase = vServer.Databases[vDatabaseName]; var vTables = vDatabase

C# Get path of class library

≯℡__Kan透↙ 提交于 2019-12-05 10:54:57
I have a class library that uses some xml files found in its own directory. When referencing this library from another project, how do I ensure the library is working from it's own directory? I tried Assembly.GetExecutingAssembly().Location but that still returns the path of the startup project. I know this is an old post but in the event someone else stumbles on it from a search, the easiest way I've found to do this is: Public Class Foo Public Shared Function GetMyPath() As String Return Path.GetDirectoryName(GetType(Foo).Assembly.Location) End Function End Class This is happening because

C#: In what assembly is SHDocVw.WebBrowser_V1 defined?

百般思念 提交于 2019-12-05 10:00:25
问题 It's used on several websites which all seem to assume the reader knows what to do to have this type available, but I have no clue. Example site, see the first comment: http://blogs.artinsoft.net/mrojas/archive/2008/09/18/newwindow2-events-in-the-c-webbrowsercontrol.aspx 回答1: It's not an assembly, it's a COM component. Project + Add Reference, Browse tab, select c:\windows\system32\shdocvw.dll. In Windows 7 pick shdocvw.tlb in the same directory instead. This generates the interop library for

VS2005: Assembly '<assembly>' is incorrectly specified as a file.

自闭症网瘾萝莉.ら 提交于 2019-12-05 08:20:56
问题 I've added a reference to the log4net assembly dll to my project. When I build I get a warning saying: Warning Assembly 'Lib\log4net.dll' is incorrectly specified as a file. I look up the help for this error on MSDN, and it says: This warning is generated during application manifest generation when the build process detects that a file reference is actually a (managed or native) assembly . This is exactly what I'm doing; the file reference is an assembly. What am I being told here? How do I

Why are framework dlls repeated in several places?

心不动则不痛 提交于 2019-12-05 05:56:40
After installing .Net 4 and getting some questions that were already answered here I also realized how the Framework dlls are repeated in several places for the different Framework versions (this is not new, it happens with previous versions, but hadn't paid attention to it until now) 1 - GAC: %systemroot%\assembly 2- Framework installation directory: %systemroot%\Microsoft.NET\Framework\v... 3- and if you have the Windows SDK installed, also in: C:\Program Files\Microsoft SDKs\Windows\ I think the last ones are the so called "Reference Assemblies" and have extra metadata to aid Visual Studio,

Type.GetType fails to create type from already loaded assembly

牧云@^-^@ 提交于 2019-12-05 05:34:42
I have program which loads an assembly using Asssembly.LoadFrom method. Some time later I attempt to use Type.GetType to create a type from that assembly (using AssemblyQualifiedName ), but the method returns null . If I set it to throw exception, it tells Could not load file or assembly '...' or one of its dependencies. The system cannot find the file specified. But I am sure the exact same assembly is already loaded (it shows in the AppDomain.CurrentDomain.GetAssemblies() list). Anybody has an idea what could be wrong and/or how to solve this issue? In order to understand why this doesn't

Preloading Assemblies

只谈情不闲聊 提交于 2019-12-05 05:22:19
At work we use DevExpress for the user interface. The first time a form employing a DevExpress control is opened there's a long pause (sometimes 15-20 sec on some clients). In Visual Studio i can see that tons of assemblies are being loaded during that phase. Is there a way to preload that assemblies into the AppDomain in the background on a thread that is spawned for example before the login screen pops up? Another choice is to force the JIT to load the assemblies asynchronious instead of doing it by hand. The trick is to simply call the constructor of the control, so the Jit knows that it

How do I combine an unmanaged dll and a managed assembly into one file?

戏子无情 提交于 2019-12-05 04:16:09
SQLite from PHX Software has combined a managed assembly (System.Data.SQLite) with an unmanaged dll (the SQLite 32- or 64-bit dll) into one file, and managed to link them together. How do I do this? Do I need to embed the managed assembly into the unmanaged dll, or vice versa? ie. my questions are: In which order do I need to do this? What tools or knowledge do I need in order to do this? How (if different) do I link to the exported functions from the unmanaged dll in my managed code? The reason I ask this is that I want to build a managed zLib wrapper. I know there is managed classes in .NET

Loading assembly at runtime fails when I copy the DLL after program startup

▼魔方 西西 提交于 2019-12-05 03:46:04
At runtime I load an assembly with Assembly assembly = Assembly.LoadFrom(@"c:\MyFolder\MyAssembly.dll"); This works if the assembly is in that folder. If the assembly is NOT in the folder I get an exception of course telling me that the assembly or one of its dependencies could not be found. I'm catching the exception and display an error message to the user. The program keeps running. If I copy now the missing assembly to the folder "c:\MyFolder" while the program is still running and trigger the function again which executes the line above I get the same exception - a System.IO