Hi Everyone,
We are looking for centrally managing NuGet package versions for .Net 4.8 projects at repo level. We just went went through the article. Is this functionality valid only for .Net core projects? Is there any way achieve it .Net 4.8 projects also.
Regards,
Rajendar.
@rajendar123 It should work yes, however there are a few things to note.
The feature is still in development, and is of preview quality, with some features not yet implemented. Restore will work in VS, but there is no tooling (in VS or command line) to add packages, change versions, and so on. Package management in VS will write changes to the project file that will cause restore failures when CPVM is enabled. Currently package modifications must be done by manually editing project and msbuild files. This is less of an issue for SDK style projects, because in Visual Studio, you can right click the project in Solution Explorer and there's an option to open/edit the project file as an xml file. This is not the case for non-SDK style projects.
Having said that, SDK style projects are not limited to .NET Core. The following project file can be used to create a .NET Framework 4.8 class library:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
</Project>
There are limitations, for example ASP.NET projects cannot be use this without migrating to ASP.NET Core, but other project types like console apps and class libraries can use this new project format without issue. This is unrelated to CPVM, but if you wish to use that feature, using SDK style projects will greatly enhance your experience during CPVM's preview period.
Most helpful comment
@rajendar123 It should work yes, however there are a few things to note.
The feature is still in development, and is of preview quality, with some features not yet implemented. Restore will work in VS, but there is no tooling (in VS or command line) to add packages, change versions, and so on. Package management in VS will write changes to the project file that will cause restore failures when CPVM is enabled. Currently package modifications must be done by manually editing project and msbuild files. This is less of an issue for SDK style projects, because in Visual Studio, you can right click the project in Solution Explorer and there's an option to open/edit the project file as an xml file. This is not the case for non-SDK style projects.
Having said that, SDK style projects are not limited to .NET Core. The following project file can be used to create a .NET Framework 4.8 class library:
There are limitations, for example ASP.NET projects cannot be use this without migrating to ASP.NET Core, but other project types like console apps and class libraries can use this new project format without issue. This is unrelated to CPVM, but if you wish to use that feature, using SDK style projects will greatly enhance your experience during CPVM's preview period.