VS 2022 New Console App project will not build - Microsoft.NETCore.App dependency exclamation point

Dan Push 1 Reputation point
2022-02-08T17:57:27.113+00:00

I installed VS 2022 Community, but when I create a new Console App (.NET 6) the entire "Dependencies" section in the Solution Explorer shows an exclamation point
I can't build the project or do much of anything

I've tried...
removed other versions of VS (2019)
reinstalled VS2022
"dotnet restore" in the project folder
moved "C:\Program Files\dotnet\" PATH value to top of list
restarted my PC after each of these steps

I'm running Windows 10 Enterprise (20H2)

Please help!

172287-image.png

172274-image.png

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,566 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,180 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 54,626 Reputation points
    2022-02-08T20:54:34.677+00:00

    right click on the dependency and open folder. the ref folder inside should have the dll's.

    if the folder is missing, then you probably need the sdk installed.

    dir C:\"Program Files"\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.1
     Volume in drive C has no label.
     Volume Serial Number is 3267-69D9
    
     Directory of C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.1
    
    01/14/2022  11:34 AM    <DIR>          .
    01/14/2022  11:34 AM    <DIR>          ..
    01/14/2022  11:34 AM    <DIR>          analyzers
    01/14/2022  11:34 AM    <DIR>          data
    01/14/2022  11:34 AM    <DIR>          ref
                   0 File(s)              0 bytes
                   5 Dir(s)  184,519,589,888 bytes free
    

  2. Francisco Malpartida 1 Reputation point
    2022-04-15T00:59:52.79+00:00

    I have the exact same problem on my end!

    0 comments No comments

  3. Foon Lam 1 Reputation point
    2023-01-02T01:49:56.207+00:00

    I had the same problem. I could not find the "AlwaysCreate" property they mentioned, but I did manage to find it when I opened up the ".vdproj" file with Notepad and did a search for it. So you need to change the value frpm "FALSE" to "TRUE" in "AlwaysCreate" = "11:FALSE". There are multiple of them, so make sure you change them all.

    0 comments No comments