Install GitExtensions on a machine with .NET 4.0 only - .net-4.0

.NET 4.0 / Visual Studio 2010 is installed on my machine.
When I execute the current installer (GitExtensions224SetupComplete.msi) it tells me that I need to install .NET 3.5.
Can one use GitExtensions with .NET 4.0 or do you have to install .NET 3.5?
If yes, how do I force the installer to use .NET 4.0?
Is there a general approach to this, which also works with other programs and installers?
Thanks

As far as I can see from GitExtensions224SetupComplete.msi, it has an explicit launch condition Installed OR NETFRAMEWORK35. That's why it doesn't let you proceed without .NET 3.5 installed.
This can mean 3 things:
.NET 3.5 is required for the application and/or the installation to run. In this case you have no choice apart from installing .NET 3.5
.NET 3.5 prerequisite is a left over. In this case you can try to cheat :)
DON'T DO THIS ON CRITICAL ENV - IT'S JUST FOR FUN
The property NETFRAMEWORK35 is set in case the registry value Install equals 1 under registry key SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5. Add this fake registry key with the only value Install and set it to 1. Then run the installer. In case it succeeds - then it's a left over. Otherwise, there's a real dependency to .NET 3.5 and you have to live with this.
Eventually, the easiest and safest way to go is to install .NET 3.5, that's for sure.

This seems to be a general problem for installers based on WiX (like a lot of Open Source programs are) In reality you could probably use it with .Net 4 but you can't force the installer to recognize it. In other words you can (probably) either compile from source and remove the .Net 3.5 version check or just give up and install .Net 3.5 (The easy way out). 3.5 works fine in parallel with .Net 4 and can be installed after .Net 4.
This is from experience, I've had the exact same problem.

Related

Is .Net 4 environment make interfere with Documentum 5.3 SP3

I have a documentum 5.3 SP3 content server installed on a machine And one .net application is also installed on the same machine
current .NET version is 2.0
and i want to install the .NET version 4.0 on that machine.
So, I want to know if that install will in any way interfere with
Documentum?
You can install different versions of .Net frameworks on a machine and everything should work fine. The documentum content server does not need .Net framework installed. So I suppose you are using something 3rd party/homebrew component, maybe you should ask the developers of that stuff.
You can install all major versions of .Net concurrently, so there should be no issue. This is completely independent of Documentum.

Assembly.LoadFrom BadImageFormatException - different behavior in .NET 4.0 and 4.5 (possibly undocumented)

According to MSDN documentation,
public static Assembly LoadFrom(string assemblyFile)
throws BadImageFormatException if
assemblyFile is not a valid assembly.
-or-
Version 2.0 or later of the common language runtime is currently loaded
and assemblyFile was compiled with a later version.
Actually, there is one extra case - loading assembly that is built for x86 from assembly that runs in x64 mode. Maybe it is included in "not a valid assembly" statement, I don't know. But this is reasonable cause of exception.
Ok, but in .NET 4.5 it doesn't! I have a .NET 4.5 WPF app, that loads different appliations for some reason. It is building for Any CPU and I'm starting it on x64 Win 7. I've been testing it on one executable, that is built for .NET 4.0 x86, and it worked fine. But when I switched my app to .NET 4.0 it began to crash on Assembly.Load method!
So, my question is, am I missing something? If not, then how did they do that - loading x86 assembly from x64 process in .NET 4.5? I'm lacking some understanding at this point.
Update
Thanks to Hans Passant, I've figured out my mistake. Actually the behavior of Assembly.Load is no different. It turned out, I didn't notice Prefer 32-bit option in project settings (or Prefer32Bit tag in .csproj file). That's why my process in .NET 4.5 ran in a 32-bit mode. This setting was true when I created WPF .NET 4.5 project. Then, when I swithced to .NET 4.0 it became inactive because there was no such an option in .NET 4.0. And when I switched back to .NET 4.5 it became false, which is so, I guess, for compatibility purpose.
Let's clear one assumption off the table quickly, there is no possible way to have different behavior on a machine that has .NET 4.5 installed. Targeting 4.0 makes no difference at runtime. The only thing that does is select a different set of reference assemblies, they prevent you from accidentally using a class that's available on .NET 4.5 but not on .NET 4.0.
There is no way to have both 4.0 and 4.5 installed on the same machine. .NET 4.5 is not a side-by-side version of the .NET framework, like 3.5 and 4.0 are side-by-side. Installing 4.5 replaces an installed 4.0 version. The CLR, the jitter, all the runtime assemblies plus the C# compiler.
It is best here to focus on the Platform target setting of your EXE project, that's the one that selects the bitness of the process. The kind of mistakes you can make is forgetting that the setting can be different for the Debug vs the Release build. And assuming that the "Active solution platform" combobox in Build + Configuration Manager has any effect. It doesn't, only the Project + Properties, Build tab, Platform target setting matters. This is a very awkward trap that many programmers have fallen into.

Require .NET 4.0 for .NET 4.5 app

This is a two part question. I need both parts addressed for a complete answer.
Part I
I have a .NET 4.5 desktop app and I'm wondering if I can deploy it to Windows XP if, within "Requirements" in the app's Installshield project, I tick the ".NET 4.0 Full Package is Installed" checkbox instead of the ".NET 4.5 Full Package is Installed" one.
I read here that:
You can compile an application for .NET 4.5 and run it on the 4.0 runtime – that is until you hit a new feature that doesn’t exist on 4.0. At which point the app bombs at runtime. Say you write some code that is mostly .NET 4.0, but only has a few of the new features of .NET 4.5 like aync/await buried deep in the bowels of the application where it only fires occasionally. .NET will happily start your application and run everything 4.0 fine, until it hits that 4.5 code – and then crash unceremoniously at runtime.
So I know what the ability of my app to run on Windows XP with .NET 4.0 depends on. Let's assume for this question that my app won't crash as described in the above quote.
Part II
I also need to know what effect choosing ".NET 4.0 Full Package is Installed" instead of ".NET 4.5 Full Package is Installed" will have when installing the app onto a machine with .NET 4.5, but not .NET 4.0, installed. Will the Installshield installer see the installed .NET 4.5 package as .NET 4.0 and thus not complain? Or will it be picky and block the app's installation since specifically .NET 4.0 is not installed?
First thing you need to do is change the Target Framework version of your projects from 4.5 to 4.0 and rebuild. If you used any 4.5 specific feature then you'll now find out. You'll need to fix errors.
Part 2 is a non-issue, .NET 4.5 is a replacement for .NET 4.0. The installer is not going to uninstall 4.5 first so it can install 4.0, that would break all existing .NET apps on that machine.

Changing framework 4.0 to 2.0 without affecting any reference

I have developed a Windows application in the 4.0 framework. After deploying my application I have tried to install it in a Windows XP SP2 system, but when I try it I get some kind of requirement error. So I decided to change my application from 4.0 to the 2.0 framework so that it can be installed in any windows OS. Before that I tried with 3.5 and 3.0 but the framework's setup size exceeded 200mb, so I chose 2.0 because it already comes along with windows xp or later. The problem I am having is while changing my framework from 4.0 to 2.0 i'm getting reference problems with system.core and system.linq so now I cant build my project. What needs to be done to fix these reference errors?
The problem is that System.Linq, for example, didn't exist in .NET 2. If you are using anything that required System.Linq methods (such as LINQ or any extension methods), you'll have to rewrite that portion of your code to use .NET 2 only options.
Personally, I would just target .NET 3.5sp1 or .NET 4, and include the web installer, as this is a small addition to your deployment (the 4.0 web installer is under 1mb - many installers include a way to just package this instead of the full framework). Most systems already have .NET 3.5sp1 (and many have 4.0), so the effort to include this in your deployment is typically far smaller than trying to rework your application to avoid it.

Why does the .net 2.0 dotnetfx.exe download and .net 4.0 dotnetf4.exe doesnt'?

We have an installer for our application that has the file dotnetfx.exe when the installer runts this file is executed and you get a message saying that the microsoft.net framework is being downloaded.
Now we are using .net 4.0 and the redistrubutable for it is 49MB and it doesnt download anything. Im assuming that explains the size.
What im wondering is...is there a .net 4.0 installer that that is smaller in size and does this 'downloading' of data like the .net 2.0 one does?
That is the correct size of the .net 4 redistributable framework. .net 3.5 was much, larger than this and microsoft worked very hard to cut the size down to this for the 4.0 release. 3.5 was absolutely huge and in my opinion practically unusable for redistribution because of its size.
.net 2 was around 23-26 meg and so the .net 4 framwork release is not terribly larger than the 2.0 framework.
I redistribute the 2.0 framework with a software installation and I do not have a "downloading" message of any kind during my installation. I include the 23 meg dot net 2 framework file in the installer which increases the size of our software setup ~23 meg.
If your last installer which used the 2.0 framework did not have the 23 meg file included and instead downloaded it, this was most likely a feature of your installation script / installation softtware itself and I do not believe that it has anything to do with the .net 2.0 framework redistribution file itself.
If you have access to your install script, definitely review the installation script and and you will most likely find that the "downloading of 2.0" feature that you like is just a feature of your installation tool / software.
So, if you like this feature, I would assume you can most likely set this up in your installation script so that your 4.0 framework also can be downloaded rather than included in the setup directly if you prefer this method of installation.
Definitely check your install script. I hope this helps. :)