assemblies

Cannot use external references with C# Console Application

落爺英雄遲暮 提交于 2019-12-04 02:49:50
I have tried all the suggestions below but still no joy. I'm now trying a console application, and let me explain exactly what I'm doing. I create a new console project in VS 2010 I add a number of references (dll's) some that aren't mine such as Castle.Winsor and N2 CMS dlls in the console app I can add using statements indicating I am using name spaces within the referenced DLLs I start writing code. As soon as I compile all the code that uses the referenced DLLs immediately complains with "The type or namespace name '' could not be found (are you missing a using directive or an assembly

Signing my assembly with a strong name stops it from working

有些话、适合烂在心里 提交于 2019-12-04 01:10:53
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 remove the strong name from the assembly, it works just fine. Any ideas on what could be the problem? Not

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

强颜欢笑 提交于 2019-12-04 00:01:12
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 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 the COM component with the SHDocVw namespace. WebBrowser_V1 is one of the types you'll get from that. You

Use of specific version reference in Visual Studio 2008

我是研究僧i 提交于 2019-12-03 23:53:18
问题 I have an assembly, Foo, which has a reference to assembly Bar (version X.X.X.2000). In the properties, the specific version is set to False. I have both Bar (x.x.x.2000) and Bar (x.x.x.1000) in my local GAC. Everything is fine. On another machine, where no version of Bar is in the GAC, but Bar (x.x.x.1000) is located in the same directory as Foo, running Foo will fail claiming it can not find Barr (x.x.x.2000) with Could not load file or assembly 'Bar, Version=x.x.x.2000, Culture=neutral,

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

我们两清 提交于 2019-12-03 22:51:33
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.Tables; } } } However, I cannot find the .dll file to add a reference too. I'm using Visual Studio

Embedding Intellisense Xml Documentation in Assembly?

核能气质少年 提交于 2019-12-03 22:13:50
I have an assembly containing very thorough XML-based documentation, which is used through Sandcastle to generate the help-files for the product. We also use the output XML files for providing proper Intellisense in Visual Studio when programmers use the assembly obviously. In order to do this, it seems we have do both supply the user with the assembly ("assembly.dll") and the documentation ("assembly.xml"). Is it somehow possible to embed the documentation within the assembly, so we'd only have to supply the single assembly-file and Visual Studio would be able to extract the information?

Force load an assembly from the /bin and not the GAC?

和自甴很熟 提交于 2019-12-03 22:10:15
I have two assemblies, created through conditional compilation (dev and real). The public surface of these assemblies is 100% identical: both are strongly named; both are signed with the same .snk and therefore have the same PublicKeyToken ; both have the same culture and the same version. I cannot change this: making them appear identical is the whole point. However, on my machine the real assembly is in the GAC. I have an ASP.NET 3.5 WebForms app that references the dev assembly. It absolutely must do that; the real assembly crashes the app. Is there a way to force a specific ASP.NET

how to delete the pluginassembly after AppDomain.Unload(domain)

爱⌒轻易说出口 提交于 2019-12-03 18:30:19
问题 i have a weird problem. i would like to delete an assembly(plugin.dll on harddisk) which is already loaded, but the assembly is locked by the operating system (vista), even if i have unloaded it. f.e. AppDomainSetup setup = new AppDomainSetup(); setup.ShadowCopyFiles = "true"; AppDomain appDomain = AppDomain.CreateDomain(assemblyName + "_AppDomain", AppDomain.CurrentDomain.Evidence, setup); IPlugin plugin = (IPlugin)appDomain.CreateInstanceFromAndUnwrap(assemblyName, "Plugin.MyPlugins"); I

Reference unmanaged assembly

 ̄綄美尐妖づ 提交于 2019-12-03 17:50:08
问题 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

Creating C# Type from full name

狂风中的少年 提交于 2019-12-03 16:03:31
问题 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 回答1: 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