Reputation: 36048
I want to develop a wpf application that runs on windows 8 without having the user install any dependencies. From doing research I found:
Windows 8 (all editions) includes the .NET Framework 4.5 as an OS component, and it is installed by default. It also includes the .NET Framework 3.5 SP1 as an OS component that is not installed by default. The .NET Framework 3.5 SP1 can be added or removed via the Programs and Features control panel.
I found that at: http://blogs.msdn.com/b/astebner/archive/2007/03/14/mailbag-what-version-of-the-net-framework-is-included-in-what-version-of-the-os.aspx
Anyhow if I build my wpf application using the .net framework 4.5 I believe it will run without the user having to install any dependencies (I am assuming user has windows 8). But what if my application references an assembly that was created using the .net framework 2.0. Once my wpf application make use of that assembly it will crash on the users computer?
If I want to prevent user from installing dependencies I will have to remove the assembly that was created using .net framework 2.0?
Upvotes: 0
Views: 184
Reputation: 6881
The target of the executable is what matters here. If you have an application that targets .NET 4, when it is run for the first time, the .NET 4 runtime will be loaded, and the entire application will run under the .NET 4 runtime, including any DLLs that were targeted at .NET 2. The .NET 4 runtime can execute code that is targeted at older .NET versions.
So the user would not have to separately install .NET 2 to run an application that's targeted at .NET 4, even if it references .NET 2 DLLs.
Upvotes: 2