assemblies

How can I locate a specific type in an Assembly *efficiently*?

I'm looking for a more efficient way to find a type in an Assembly that derives from a known specific type. Basically, I have a plugin architecture in my application, and for the longest time we've been doing this: For Each t As Type In assem.GetTypes() If t.BaseType Is pluginType Then 'Do Stuff here' End If Next Some ...

Preloading Assemblies

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 ...

How to know if an assembly is Private or Public

Hi, I have an assembly (it's a DLL) I want to know if it's private or public?? How can I do that, it exists a program to do that? or Visual Studio can tell you? Thanks ...

Suppress MessageBox from a referenced assembly

How do I suppress a MessageBox from showing that comes from a reference to an assembly that I do not own (nor have the code for)? For example, my application (MyApplication.exe) is referencing an assembly coded by someone else (SomeoneElsesAssembly.dll). Inside of this assembly I'm calling a static method, which does what it's supposes...

Embedding publisher policy into assembly

Hello there, I'm developing a shared assembly, version 2.0.0.0. For future compatibility, I'd like to bind all the 2.0.x.x versions to the latest version installed. To do so I need a publisher policy file. Is there a way to embed the publisher policy directly in the "code" assembly instead of having to install two different assemblies? ...

Loading new assembly when Serializing

I have a loop in a BackgroundWorker that saves some stuff via xml Serialization when needed but this seems to load a new assembly each time 'xxyyzz.Main.vshost.exe' (Managed): Loaded '9skkbvdl' 'xxyyzz.Main.vshost.exe' (Managed): Loaded 'd2k4bdda' and so on. Why is this happening? Is there any thing i can do about it? Is this...

Disabling a module in a program by not shipping the .dll

Hi, If you distribute a .net web application, and you want a certain module of the application to be disabled, AND you don't want to ship the source with it, is it a reasonable solution to just not include the necessary .dll for that module? I know you can do things programatically, but as long as you don't ship the .dll things should ...

How do I create a .NET assembly in IronPython and call it from C#?

I want to create an assembly using IronPython can call it from C#. Here are two things I am not asking. I'm not asking how to call C# from IronPython. The easiest documentation to find describes how to call C# from inside IronPython. (For example, the tutorial that ships with IronPython.) I want to do the opposite, call IronPython fro...

Work out the type of c# application a class contained in a DLL is being used by

Is there any way to know in C# the type of application that is running. Windows Service ASP.NET Windows Form Console I would like to react to the application type but cannot find a way to determine it. ...

Why is ReflectionOnlyAssemblyResolve not executed when trying to Assembly.ReflectionOnlyLoad?

I'm trying to load a few modules via hooking into the AppDomain.AssemblyResolve and AppDomain.ReflectionOnlyAssemblyResolve events. While I got the former to work, I fail miserably on the latter. I've boiled my problem down to this little program: public static class AssemblyLoader { static void Main(string[] args) { App...

Can you build ASP.net User controls as assemblies?

Is there some setting in VS2K8 or some command line utility that can compile my user controls as .net assemblies? Is it even possible? ...

major.minor.build.revision versioning style vs year.month.day.whatever versioning style

Is there any reason to use one versioning style over the other for .NET assemblies???? I'd like to know if there are any advantages/disadvantages in using either style besides taste. ...

How do I force where an assembly is loaded from?

I have developed a console utility that performs some operations against a server application. Due to the nature of the server app I'm working with, I need to execute this utility on the server. The problem is that the utility is referencing a common DLL that has previously been deployed to the server's GAC. Since the common DLL's deplo...

Specify the assembly explicitly?

I am getting this ambiguous reference error with some software that came from a vendor. The problem is, I need to keep both DLLs in my project, because various parts of it use code from both. So... I need to know the syntax for explicitly specifying the assembly. In other words, I want to do exactly what the error message is telling me t...

C# CLR Assembly Query

I am creating a C# assembly for MS SQL Server 2005 for encryption/decryption. I need to query the database in this assembly, and was wondering what the preferred method of connecting to the database is? I believe we would not want to have a username/password in the connection string. Since the assembly is registered in MS SQL does it h...

How can I launch a program from memory in C#?

I have some UI application that lives in the user's task bar that is written in C#. The EXE for the tool is checked in to our source control system on a number of projects that use it so we are able to update the version they run with by checking in updated EXE. The problem is that when the users get the latest revision of the exe, the ...

CLR Assembly for Encryption/Decryption

We recently implemented some symmetric keys in MS SQL 2005 for encrypting and decrypting credit card, check routing/account numbers. Ideally, we would like a user defined function to be able to perform the encryption and decryption, however, its not possible since the encryptbykey and decryptbykey functions cannot be used within user de...

C# Assembly Injection Check

I'm creating an assembly in C# for MS SQL 2005. This assembly creates a stored procedure and runs a dynamic query based on parameters passed into the stored procedure. Is there a simple function in C# to prevent SQL injection? For example string myQuery = "SELECT * FROM dbo.MyTable WHERE lastName = '" + injectionCheck(arg1) + "'"; T...

MSSQL Assemblies and SQLBinary DataType

I have a c# assembly which takes in a SQLBinary variable to decrypt... [SqlProcedure(Name="Decrypt")] public static SqlInt32 Decrypt(SqlBinary toDecrypt) { return runQuery(toDecrypt); } // decrypt or encrypt is determined based on the datatype of argValue private static SqlInt32 runQuery(object argValue) { // create connection ...

C# SQL Server Assembly Raise Error?

I have several assemblies for SQL Server 2005. If invalid data is entered to be run by my SP function (using C#), I want to pass back an error to sql server. For example, if someone enters something I don't want them to then I want to output something back to SQL Server prior to executing any query. Any ideas? ...