How to detect .Net 2.0 SP1 in my installer? - .net-2.0

How can I detect if .Net 2.0 SP1 is installed from my installer msi, and abort the install if it is not present?
I know how to do this in code, but it seems cleaner do it in the vdproj. It feels more declarative.

All you need is a Launch Condition Editor where you can set minimum .net version installed on the client machine to 2.2.30729 (.net 2.0 sp1). Hopes it helps.

You could check the value of the MsiNetAssemblySupport property, comparing it to the version number for Fusion.dll when .Net 2.0 SP1 is installed.
Details from MSDN - http://msdn.microsoft.com/en-us/library/aa370325%28VS.85%29.aspx

Related

PowerShell not working on Windows 2008 R2

I have accidently installed .Net 4.5 on my Windows Server 2008 R2 for PowerShell 5.1, but now I have reverted to .Net 4.0 version and now the PowerShell is not working. It gives below error.
Windows PowerShell terminated with the following error: Method not found: 'System.Threading.Tasks.Task System.Threading.Tasks.Task.Run(System.Action)'
What should I do to resolve this?
Perhaps this is the same issue you have: https://michlstechblog.info/blog/powershell-method-not-found-system-threading-tasks-task-system-threading-tasks-task-runsystem-action/
If that does not work for you, you can always reinstall Powershell 3.0. Download it from https://www.microsoft.com/en-us/download/details.aspx?id=34595
You can also install a higher version if you would like. It would do no harm. Reinstall will require a reboot as they come in the form of KBs.
You will need to download Windows Management Framework 3.0 or install Microsoft .NET Framework 4.5 to correct your issue.
Windows Management Framework 3.0 - link
Microsoft .NET Framework 4.0 - link
or you can get
Windows Management Framework 4.0 - link
Microsoft .NET Framework 4.5 - link

.Net framework 4.0 issue on windows 10 os

I am trying to install one windows application on windows 10 platform. My application need to install Dot Net Framework 4.0 when trying to install then error message will appear and say to install Dot Net Framework 4.0 after that when I try to install Dot Net Framework 4.0 then error message shows me Dot Net Framework 4.0 already install in this system so I can't understand what is the issue with that.
Windows 10 included Dot Net Framework 4.0 and above.
Windows 10 (all editions) includes the .NET Framework 4.6 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.
https://blogs.msdn.microsoft.com/astebner/2007/03/14/mailbag-what-version-of-the-net-framework-is-included-in-what-version-of-the-os/
So you don't need to install as already "Installed"...

Running the "migrate.exe" for entity framework 6.0.2 migrations in Windows 2003 and XP "Not a valid win32 application" exception

Our product needs to be compatible with versions of windows including Server 2003 and XP.
We have code first entity framework projects with various migrations.
We are deploying these migrations to create or update a database using the "migrate.exe", file version 6.0.21211.0, supplied in entity framework 6.0.2 nuget package.
When using XP itself with visual studio 2010 or Windows 7 with visual studio 2013 to install the package every time we run "migrate.exe", on an xp or server 2003 machine, we are getting a "not a valid win32 application" exception.
Is there a good reason why "migrate.exe" will not run on windows xp and windows server 2003 other than the fact they are operating systems that nobody really wants to support any more?
I managed to resolve this issue by downloading the source code for 6.0.2 version of entity framework, un-signing it in properties, then building it through .net 4.0 and not 4.5 by changing the solution configurations to Release40.
Source code can be found here:
http://entityframework.codeplex.com/SourceControl/changeset/7648d33dfb53589d9c32b605c61758a5a6c0b80b
I found it quite difficult to locate it.
You probably don't have .NET Framework installed on the machines where it fails.
(As a side note I believe both XP and 2003 go out of support soon so you may want to upgrade your environment...)

How to manually install .Net 4.0.x and 4.5 on XP

XP isn't a supported OS for .NET 4.5. This is a known issue.
I read a few months back that the reason XP can't install 4.5 is because there are kernel API that 4.5 calls which don't exist on XP. I also read that it would be possible to inject your own implementation of the 'new' kernel calls to an XP machine - and 4.5 could run.
I can no longer find this information. Does anyone know more about this?
A second, but related, question is - how can I take upgraded .Net 4.0 libraries from a windows 7 machine (which had 4.5 installed) and inject them into an xp machine? I believe I read that the implemention files of 4.5 are actually the same as the 4.0 files, there are not two sets. And in fact, the two .net folders (4.0 and 4.5) are only the interfaces - which link back to these same files. If this is the case, then a manual injection of the 4.0 files would likely need the solution to my first question.
In short - does anyone have more information about hacking/manually upgraded .net for xp?

Add .NET 2.0 SP1 as a prerequisite for deployment project

I have a .NET 2.0 application that has recently had contributions that are Service Pack 1 dependent. The deployment project has detected .NET 2.0 as a prerequisite, but NOT SP1. How do I include SP1 as a dependency/prerequisite in my deployment project?
You'll want to setup launch condition in your deployment project to make sure version 2.0 SP1 is installed. You'll want to set a requirement based off the MsiNetAssemblySupport variable, tied to the version number of .NET 2.0 SP1 (2.0.50727.1433 and above according to this page.)
Bootstrapping the project to actually download the framework if it isn't installed is a different matter, and there are plenty of articles out there on how to do that.