Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.2K
Views
Open .net framework 4.5 project in VS 2022. Is there any workaround?

Is there anyway to open and work on .net framework 4.5 project in visual studio 2022.

May be problem is not with VS2022 but as .net framework 4.5 developer pack is not available any more .. my project can not be changed target version .. Is there any workaround?

enter image description here enter image description here

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

For .NET 4.0, this command will install it for you if you have the Visual Studio 2019 files cached:

msiexec.exe /i "%ALLUSERSPROFILE%\Microsoft\VisualStudio\Packages\Microsoft.Net.4.TargetingPack,version=4.0.30319.1\netfx_dtp.msi" EXTUI=1

For .NET 4.5, this might work, though I haven't tried it:

msiexec.exe /i "%ALLUSERSPROFILE%\Microsoft\VisualStudio\Packages\Microsoft.Net.4.5.2.TargetingPack,version=4.5.51651.1\netfx_452mtpack.msi" EXTUI=1
over 4 years ago · Santiago Trujillo Report

0

  • Download Microsoft.NETFramework.ReferenceAssemblies.net45 from nuget.org
  • Open the package as zip
  • copy the files from build\.NETFramework\v4.5\ to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5

For more details: Building a project that target .NET Framework 4.5 in Visual Studio 2022

over 4 years ago · Santiago Trujillo Report

0

While all of the proposed, and even the accepted, solutions will work, none of them are the preferred approach.

The only thing you need to do is add a reference to the NuGet package as follows:

<ItemGroup>
 <PackageReference Include="microsoft.netframework.referenceassemblies.net45"
                   Version="1.0.2" PrivateAssets="All" />
</ItemGroup>

You can make this change directly in the *.csproj or via the Package Manager UI in Visual Studio. The MSBuild extensions in the package will take care of the rest of the magic. There are no scripts to write, files to copy, or permissions to grant. This will work without elevation, which would be required to write under %PROGRAMFILES%.

Setting PrivateAssets="All" will make the package reference design-time only. It will not be picked up or included as a transitive dependency if your target also builds a NuGet package.

Roslyn Issue 56161: Remove .NET 4.5 Targeting Pack Requirement further confirms that this how you use reference assemblies when a targeting pack is not installed. This approach is useful any time you don't want to install a targeting pack or it's otherwise unavailable - say on a build server without Visual Studio.

I ran into the same issue after uninstalling Visual Studio 2019. The build worked as expected from Visual Studio and the CLI after adding this package reference.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!