Build apps against Microsoft.NETFramework.ReferenceAssemblies

Neo 421 Reputation points

When I try to download .NET Framework v4.0 devpack, I amd directed to Build apps against Microsoft.NETFramework.ReferenceAssemblies.

I added package.config as outlined in the doc:

  <package id="Microsoft.NETFramework.ReferenceAssemblies" version="1.0.3" developmentDependency="true" />

Then I build my project so that the packge is restored. But there is no v4.0 in the list of target framework in project Properties. I also tried manually edit project.csproj file by setting TargetFrameworkVersion>v4.0</TargetFrameworkVersion> but I cannot open the project and I was prompted by VS to upgrade to v4.8 or download devpack for 4.0.

That's frustrating. How should I do?

Microsoft Technologies based on the .NET software framework.
2,312 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 21,946 Reputation points Microsoft Vendor


    Try the following steps.

    Install Microsoft.NETFramework.ReferenceAssemblies.net40.

    User's image

    Restore NuGet packages:

    msbuild /t:restore

    Build the project:


    Best Regards.

    Jiachen Li

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

1 additional answer

Sort by: Most helpful
  1. Vahid Ghafarpour 8,545 Reputation points

    If you are specifically looking for the .NET Framework v4.0 development pack, you can download it directly from the Microsoft Download Center by searching for ".NET Framework 4.0 Developer Pack" or by using the following link:

    If you have already added the "Microsoft.NETFramework.ReferenceAssemblies" package to your project and it is not showing the .NET Framework v4.0 as a target framework, you may need to check your project settings to make sure it is set up correctly.

    To do this, open the project properties in Visual Studio, and under the "Application" tab, make sure that the "Target framework" drop-down list is set to ".NET Framework 4" or ".NET Framework 4.0".

    If you are still experiencing issues with your project, you may want to consider upgrading to a newer version of the .NET Framework, as the v4.0 has reached end of support and may not be fully compatible with the latest version of Visual Studio.