Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.3K
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda