views:

320

answers:

10

Hello

How do I only include certain dlls of the .Net framework which are used in my program along with the setup project instead of installing the whole framework?

Thanks

+5  A: 

You want to deploy a .NET Application to a server, that doesn't have .NET installed and only have it install the specific System.* dlls required for you're application ?

I'd be pretty sure that you can't do this. There's more to the Framework than just a bunch of DLLs in the GAC. (e.g. CLR, registry entries etc...). You'll need to install the framework on the client machine

Eoin Campbell
+4  A: 

I'm pretty sure that can't be done. C# is managed code, and therefore needs the CLR and the framework to support it.

Unlike other languages that get compiled to binary, .NET code gets compiled to MSIL (Microsoft Intermediate Language), so it cannot be run directly by the hardware.

chills42
+1  A: 

I know of the Salamander tools... but haven't used them.

From their site: "Salamander .NET Linker, Native Compiler and Mini-Deployment Tool; Deploy .NET w/o Framework"

Lucero
+2  A: 

No. In order for your pogram to run, the target machine must have the appropriate version of the .Net framework installed on it. You don't need to bundle the entire SDK with your application but you do need to include the appropriate .Net framework redistributable for your application.

JaredPar
A: 

Have you looked at ngen?

http://msdn.microsoft.com/en-us/library/6t9t5wcf(VS.80).aspx

Winston Smith
How would that help???
0xA3
+1  A: 

You can use tools like Xenocode to link the assemblies.

There's a free linker (from Microsoft, I think), but it's name escapes me.

dommer
A: 

It would be possible to use reflection to identify the dependent assemblies and "link" them with your deployment. I've used a similar technique in Java land.

Adam Fyles
However, you would still need a CLR being installed on the target system.
0xA3
+1  A: 

This is not possible. You have to have proper .Net framework runtime in place on the target machine. What you have asked for is possible with 3rd party libraries/assemblies but not with .Net runtime.

this. __curious_geek
+3  A: 

Since .Net 3.5 SP1 there has been the option of using the .NET Framework Client Profile. This enables you to distribute a subset of the full .Net package in certain supported scenarios. It still requires you to use an installer though - you can't just distribute individual assemblies. The benefit is a significant reduction in package size and deployment time.

Stu Mackellar
+3  A: 

I would recommend the .NET Client Profile, described here. "The .NET Framework Client Profile is a subset of the full .NET Framework 3.5 SP1 that targets client applications. It provides a streamlined subset of Windows Presentation Foundation (WPF), Windows Forms, Windows Communication Foundation (WCF), and ClickOnce features. This enables rapid deployment scenarios for WPF, Windows Forms, WCF, and console applications that target the .NET Framework Client Profile."

JohnW