VS 2019 Project Target Framework Not Installed - .Net Framework 4.0 - visual-studio

Just installed VS 2019 Pro on a new system. When I open a solution with .net 4.0 project, I get this error: Project Target Framework Not Installed.
When I choose download it, it goes here but does not have option for .net framework 4.0.
In project settings there is no option for .Net Framework 4.0 in targeting framework:
https://dotnet.microsoft.com/en-us/download/visual-studio-sdks?cid=getdotnetsdk
I have tried installing 4.6.2, 4.5.2, etc.
How can I get this project to open? It opens on my other machine. It has these options for Target framework in project settings:
Please don't say change the framework version, we need this older version for very old computers running XP and Win 7 that cannot be upgraded.
thank you

You have to go directly to their download site. As shown in another correct answer that was downvoted, it's still available even though it's past end-of-life.
https://stackoverflow.com/a/72870727/9008140
You can package the install files with your app just in case, although most likely your installer will see that it's missing and download it anyway.

You can try downloading .Net 4.0 here: https://dotnet.microsoft.com/en-us/download/dotnet-framework/net40
Mandatory warning: Installing an old, unmaintained .Net framework comes with security risks. It's up to you to determine how much those Windows XP PCs are vulnerable and manage said risks.

Related

What is the best way to install .Net Core SDK 2.2 for development

I am going through a tutorial to create a Razor page App in Visual Studio 2019:
https://learn.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/razor-pages-start?view=aspnetcore-2.2&tabs=visual-studio
On this page it lists the prerequisites:
1) Visual Studio 2019 with the ASP.NET and web development workload
2) .NET Core SDK 2.2 or later
I downloaded the Visual Studio 2019 install so I have that ready to go.
But when I click on the ".NET Core SDK 2.2 or later" link it takes me here:
https://dotnet.microsoft.com/download/archives
And when I click on that link it takes me here:
https://dotnet.microsoft.com/download/dotnet-core/2.2
And when I click on ".Net Core Downloads" it takes me here:
https://dotnet.microsoft.com/download/dotnet-core
And finally when I click on .Net Core 2.2 (Current) it takes me here:
https://dotnet.microsoft.com/download/dotnet-core/2.2
Ah finally I am on the v2.2.6 page but now the installs are split in 2.
1) Build apps - SDK 2.2.401
2) Run apps - Runtime 2.2.6
I have never seen this before, having to install two pieces.
Question number 1: If I just install Visual Studio 2019 will I have everything I need for development? Or do I need to install .Net Core 2.2.n also.
Question number 2: If I need to install .Net Core 2.2.6 (current) do I need to install both SDK and Runtime separately? And if so is there a single file to install both at the same time anywhere?
Or do I need to install both (for windows):
SDK 2.2.401 - NET Core Installer: x64
Runtime 2.2.6 - ASP.NET Core Installer: x64
I guess I will start experimenting.
Just confusing. I guess list-sdks would then show 2.2.401 and not 2.2.6. And then there must be separate list commands for runtime and release?
Yep confusing.
I know preview 3 is out.
They have a note here at the top it is coming out:
.NET Conf 2019
.NET Core 3.0 launches at .NET Conf 2019 September 23-25, a free, virtual developer event. -
https://dotnet.microsoft.com/download/dotnet-core/2.2
If I just install Visual Studio 2019 will I have everything I need
for development? Or do I need to install .Net Core 2.2.n also.
When you install VS, you can configure your specific development environment by choosing corresponding workloads and components according to your needs. If you want to develop .net desktop projects like winform and wpf, you should choose .Net desktop development workload, and if you only want to develop Razor Page app, you just need to install VS2019 with ASP.NET and web development workload.
Normal if we choose this workload, vs installer will install .net framework(4.0 to 4.6) and asp.net core 2.1 for you by default. However, there's no single component for .net core SDK 2.2 when installing. So apart from VS with ASP.NET and web development workload, we need to manually install the .net core 2.2 SDK.
If I need to install .Net Core 2.2.6 (current) do I need to install
both SDK and Runtime separately? And if so is there a single file to
install both at the same time anywhere? Or do I need to install both
(for windows)
As for question2, I never install the sdk in that way. I use another way to download and install the sdk. Here is the download link I use.I think you only need to install this SDK:
The SDK includes everything you need to build and run .net core applications while the runtime includes everything you need to run .net core applications.The runtime is included in the SDK. (So you don't need to install the runtime separately)
In summary, to develop razor pages, you need to install VS with ASP.NET and web development workload and the SDK mentioned in the picture above. Just do as the document suggests. Hope it helps:)
I too was confused by this. When I finished installing ONLY the SDK .NET Core Installer: x64 (file dotnet-sdk-3.0.100-win-x64.exe) the installer showed this message:
The following were installed at: 'C:\Program Files\dotnet'
• .NET Core SDK 3.0.100
• .NET Core Runtime 3.0.0
• ASP.NET Core Runtime 3.0.0
• .NET Core Windows Desktop Runtime 3.0.0
As you can see, only running the SDK installer also installs the runtime, the ASP.NET runtime, and the Desktop runtime. So it's not necessary to install these separately.
TL;DR If you are developer just download the SDK Installer and run that

How can we migrate existing web applications from .net 2.0 to 4.0 in installshield project

We have a number of Installshield projects that install and configure IIS applications. We have shipped several versions of the different applications (over 7 versions of 3 applications) and would now like to upgrade to use .net 4.0 instead of 2.0 & 3.5.
After modifying the "Internet Information Services" settings to change the ASP.NET Version on the web sites/application to 4.0.30319 and the .Net Framework version to v4.0 under the application pool, the installer correctly creates an application with the 4.0 version in IIS 6 and below, and in IIS 7 and above it correctly sets the pool to use v4.0, but upgrades do not work for any targets.
The upgrades install OK, but the .Net version of the virtual directory or application pool remain unchanged. Changing it manually works of course, but this would lead to increased support issues.
I have tried changing the upgrade to be a major upgrade, with no success, I am currently working on a custom action to change the .Net version after installation, but I don't have much experience with this feature of Installshield.
Has anyone experienced this issue? Are there any preferred ways of achieving this? (custom actions, or a .Net installer class, WIX is not an option)
Thanks
Without spending hours to dig into it... one quick solution would be to rename the app pools in your new installer and let a major upgrade create the new and remove the old. After all, if you are changing from .NET 2.0 to 4.0, in a sense you are creating a component that is not backwards compatible and thus should be a new component.

Web Developer 2010 Express does not list 4.0 framework

Whatever I do for several days now, Web Developer 2010 Express does not see 4.0 NET Framework. If to right click on solution properties in the Application – Target Framework it lists 2.0, 3.0 and 3.5, which are NOT installed on my computer but 4.0 which is actually installed. I tried to clean all using dotnetfx_cleanup_tool, reinstalled 4.0 client and full several times, copied reference assemblies to different folders and so on but WDE still does not see it.
I also have SDK for Windows 7 and .NET Framework 4 installed.
Where and how does it find frameworks, does in scan registry or some config file?
To target .NET 2.0/3.0/3.5, you have to install .NET 3.5.
And Web Develoepr requires full profile, not client profile.

Why can't I change target framework in vs2010?

I'm trying to upgrade an old vs 2003 project and install it on a newer server, windows 2008 (maybe r2, don't know) which seems to have frameworks 2.0, 3 and 3.5. I did this upgrade by opening the project in vs2010 and letting it upgrade it for me. When trying to install it on this new server it says I need framework 4 and I don't understand why? Project -> properties -> compile -> advanced compile options, target framework shows 2.0. Shouldn't this mean only 2.0 should be needed on machine it will be installed in?
Any ideas what I'm doing wrong?
You need to ensure that all aspects of the code including installer target the right framework.

Visual Studio 2010 managed c++ targets .NET 2.0 PROBLEM

For someone who's been down this road, please share your breadcrumbs.
I have old VS2005 solution. Most of the parts are c# but I have one c++ managed project. Dev machine: Windows XP. Target framework version: 2.0
I moved the project to the Windows 7 64 BIT, VS 2010, did the project conversion. First thing I noticed were build errors - projects depending on one what is in c++ complained that project referenced has target 4.0 and I want to use it in project that (properly) targets 2.0.
OK, so I used some tips and set my project target to .NET 2.0. NOW: VS2010 complains that it cannot load the project because I need to install framework 2.0. OK, so I try to install it, and nothing - since installer detects .NET 2.0 as a part of the operating system.
WTF?
Admins, please create WTF tag for me here :)
It is not the .NET version that's the problem. The C++ build system currently does not directly support building for pre-.NET 4.0 targets. It requires VS2008 to be installed so it can use its tool chain. Sounds like you don't have it.
This blog post explains the workaround. You can upvote this feedback article if you're unhappy with that. No idea if this is slated to be fixed in SP1, this is not drawing a lot of votes.

Resources