Azure DevOps : Building Visual Studio Solution containing mixture of .Net 6 and .Net Framework projects - azure-devops

I am stuck on an issue building my solution containing .NET 6 project and .NET Framework (4.0 and 4.6.1) projects on Azure DevOps build pipeline (with dotnet build and msbuild task).
I cannot use windows-2019 as build agent coz of .NET 6 and unable to make work windows-2022 coz of .NET framework < 4.8
anyone come across this and know how you/they tackled this situation please?
Upgrading .NET Framework option is an expensive approach time-wise.
Any help appreciated.
Thanks

Azure DevOps : Building Visual Studio Solution containing mixture of .Net 6 and .Net Framework projects
Just as you know, the .NET Core SDK and .NET Framework supported by Windows 2019 are:
And the .NET Core SDK and .NET Framework supported by Windows 2022 are:
So, you could not use the hosted agent Windows 2019 or Windows 2022 to build your mixture projects.
As workaround, you could create your private agent to install the .NET 6 and .NET Framework (4.0 and 4.6.1) SDK on your local machine, if you do not want to upgrade .NET Framework:
Self-hosted Windows agents

Related

How can I specify the minor version of a .Net 6 target application to 6.0.1

I have a .Net 6 application that is deployed to a large number of desktops. Our IT infrastructure team installs a specific version of the .Net 6 (6.0.1)
When I compile this in Visual Studio or in a Azure DevOps pipeline the latest available .Net 6 version is taken. This is problematic because we don't want to keep on updating the .Net6 version on our many desktops
In the csproj file
<TargetFramework>net6.0-windows</TargetFramework>
Ideally I would like to specify something like
<TargetFramework>net6.0-windows;netcoreapp6.0.1</TargetFramework>
But this does not work. How can I specify that the target should be .Net 6.0.1 in Visual Studio or in the Build step in my Build Pipeline?
In Azure DevOps pipeline, the Use .NET Core task may help you. You can add this task before build.
Use this task to acquire a specific version of .NET Core from the
Internet or the tools cache and add it to the PATH.
You can also use this task to change the version of .NET Core used in
subsequent tasks like .NET Core cli task.
steps:
- task: UseDotNet#2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 6.0.1
installationPath: $(Agent.ToolsDirectory)/dotnet

Can not select .NET Frameworks above 4.8

Hey I tried to install the latest .NET Framework 6.0.1 from the official Microsoft Website and it shows as installed inside the Visual Studio Installer but I am somehow not able to select it. Neither can I upgrade existing Applications to 6.0 nor create Applications with .NET Framework 6.0.
So i tried installing .NET Framework 5.0 instead but it has the excatly same issues.
The highest Version that I can choose is .NET Framework 4.8.
In case it is important I am on Windows 10 - 21H1 - 19044.1415.
Image 1
Image 2
Image 3
Last version of .NET Framework is 4.8. Last version of .NET is .NET 6. They are not the same thing, .NET is a successor of .NET Core.

Will .Net framework 4.8 support Microsoft enterprise library v6.0?

Since some of our applications are written in .Net framework 2.0 & 4.5, We've plan to migrate our applications to .Net framework 4.8 and we have used MS enterprise library v3.0 & v5.0 and would like to uplift to enterprise library v6.0 Before going to migrate, need to know will the latest .Net framework 4.8 support enterprise library v6.0.
There is a port of Enterprise Library 6.0 that is supports .Net Core and .Net Standard 2.0.
I have not used that yet, so I cannot tell anything about its quality but based on the Nuget stats it seems tell that people are using these packages.
Also the original Microsoft Enterprise Library source code was published on GitHub so you could recompile the whole project using updated references, not sure how much effort would that cost.

Do not have .NET Framework 4.5 multi targeting pack in VS 2012 Ultimate

I have install microsoft vs 2012 ultimate into windows 7, but it does not include .net framework 4.5 multi targeting pack. So, where can I get the multi targeting pack and install it?
You can find it here on MSDN: .NET Framework Multi-Targeting Packs and SDK’s for Visual Studio 2012

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.