To move code into production my employer uses a build server which creates the artifacts that will be deployed to testing and later production servers. The latest version of Visual Studio loaded on this machine was 2017. I wrote an application which needed .NET Core – so I had Visual Studio 2019 installed on the build server which also installed a number of older versions of the .NET SDK along with it. The build failed because company policy states that no software which is out of support can be put on production servers – so all the versions of .NET Core SDK on the build server were removed! I had the .NET Core 6 SDK installed to replace the earlier versions – but later realized it won’t work with Visual Studio 2019. Do I need to go back to the techies and have them also install Visual Studio 2022 on the build box?
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
Visual studio is supported for 10 years, so VS2019 should be good until 2029.
The only supported versions of the .Net core-branch is .Net 6 & 7, and these require VS2022. Asking to have VS 2022 installed on the build box seem perfectly reasonable. But the decision to update Visual studio versions need to be made by your entire development department, since you probably want all developers to run the same version.
However, your IT policy seem fairly onerous. Using the strict interpretation of your IT department would mean that you would be forced to update all products to the latest .Net version at least every other year. While it is a good idea to keep up to date, the cost could easily outweigh the benefit for internal tools or other software not frequently updated.
There should also be a fairly minimal security risk with running an old .Net sdk on the build server. The only input should be source code, and possibly nuget packages. If some attacker get access to the source you likely have bigger problems than potential exploits in the sdk.
Although Visual Studio 2019 does not support .net 6.0, you do not need to install Visual Studio 2022 on the server. Because normal development activities will not be performed on the server, you only need to install the corresponding .net sdk version.
And it seems that there are different versions of .net sdk in your operating environment, you can specify the corresponding .net sdk in the following way
Here is a simple example where I changed .net 7.0.100 to .net 6.0.408 using cmd: