Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# error when I try to run

C# error when I try to run

Scheduled Pinned Locked Moved C#
csharpdotnetvisual-studiocomhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_16073627
    wrote on last edited by
    #1

    This is the error I get when I try to run the sample app: _The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks_ I have downloaded and run "ndp481-devpack-enu.exe" from "dotnet.microsoft.com/en-us/download/visual-studio-sdks?cid=msbuild-developerpacks". But I am new to C# so I may have done something wrong.

    OriginalGriffO Richard DeemingR 2 Replies Last reply
    0
    • M Member_16073627

      This is the error I get when I try to run the sample app: _The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks_ I have downloaded and run "ndp481-devpack-enu.exe" from "dotnet.microsoft.com/en-us/download/visual-studio-sdks?cid=msbuild-developerpacks". But I am new to C# so I may have done something wrong.

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      If you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them. Posting this here relies on them "dropping by" and realising it is for them - we have no idea what "sample app" you are referring to!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • M Member_16073627

        This is the error I get when I try to run the sample app: _The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks_ I have downloaded and run "ndp481-devpack-enu.exe" from "dotnet.microsoft.com/en-us/download/visual-studio-sdks?cid=msbuild-developerpacks". But I am new to C# so I may have done something wrong.

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        Member 16073627 wrote:

        The reference assemblies for .NETFramework,Version=v4.0 ... ndp481-devpack-enu.exe

        You have downloaded the developer pack for .NET Framework 4.8.1, whereas your error message says your project targets .NET Framework 4.0.0. The page you've linked to doesn't provide a download for 4.0.0; this page[^] explains why:

        Install the .NET Framework developer pack or redistributable - .NET Framework | Microsoft Learn[^]:

        Starting with Visual Studio 2022, Visual Studio no longer includes .NET Framework components for .NET Framework 4.0 - 4.5.1 because these versions are no longer supported. Visual Studio 2022 and later versions can't build apps that target .NET Framework 4.0 through .NET Framework 4.5.1. To continue building these apps, you can use Visual Studio 2019 or an earlier version.

        According to this page[^], if you install VS2019 and select the ".NET 4 multi targeting pack" option, then you may be able to build .NET Framework 4.0 applications in VS2022. Otherwise, you'll need to stick with VS2019.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups