Skip to content

System.Private.CoreLib.csproj fails to load in System.Private.CoreLib.sln without global installations of nightly/preview SDK #36349

Description

@Gnbrkm41

The project fails to load with the log Project "C:\users\gotos\source\repos\runtime\src\coreclr\src\System.Private.CoreLib\codeOptimization.targets" was not imported by "C:\users\gotos\source\repos\runtime\src\coreclr\src\System.Private.CoreLib\System.Private.CoreLib.csproj" at (401,3), due to the file not existing.. This is after building Clr+Libs subset successfully, via build -subset Clr+Libs -runtimeConfig Release on a clean repo.

The said codeOptimization.targets file indeed does not seem to exist in the specified folder.

Activity

  1. danmoseley commented on May 13, 2020

    @danmoseley
    Contributor
    C:\git\runtime\src\coreclr\src\System.Private.CoreLib\System.Private.CoreLib.csproj:
      401:   <Import Project="$(RepositoryEngineeringDir)codeOptimization.targets" />

    This means $(RepositoryEngineeringDir) is not getting set. Which apparently should happen here:

    C:\git\runtime\Directory.Build.props:
       22    <PropertyGroup Condition="'$(SkipImportArcadeSdkFromRoot)' == 'true'">
       23      <RepoRoot>$([MSBuild]::EnsureTrailingSlash('$(MSBuildThisFileDirectory)'))</RepoRoot>
       24:     <RepositoryEngineeringDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'eng'))</RepositoryEngineeringDir>

    I don't know what '$(SkipImportArcadeSdkFromRoot)' == 'true' is about. But it's apparently set here

    C:\git\runtime\src\coreclr\Directory.Build.props:
        2  
        3    <PropertyGroup>
        4:     <SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot>

    @ViktorHofer ?

  2. ViktorHofer commented on May 14, 2020

    @ViktorHofer
    Member

    Just tried to repro this locally without success. The project both loads and builds successfully for me.

    The said codeOptimization.targets file indeed does not seem to exist in the specified folder.

    You mean on your local enlistment, this file is missing from the root eng folder?

    I don't know what '$(SkipImportArcadeSdkFromRoot)' == 'true' is about. But it's apparently set here

    This property determines if the Arcade SDK should be imported in the root's Directory.Build.props/targets files.

  3. Gnbrkm41 commented on May 14, 2020

    @Gnbrkm41
    ContributorAuthor

    You mean on your local enlistment, this file is missing from the root eng folder?

    For some reason, it seems to look for the file from the solution root (src\coreclr\src\System.Private.CoreLib\codeOptimization.targets).

    I am not the only one having this problem; @KoziLord was having this problem yesterday too.

  4. ViktorHofer commented on May 14, 2020

    @ViktorHofer
    Member

    Can you please send me a design time binlog by capturing the loading of the project? https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProjectSystemTools

  5. Gnbrkm41 commented on May 14, 2020

    @Gnbrkm41
    ContributorAuthor

    I have installed the extension, but I am not sure how I am supposed to use it; I opened the Build logging windows and have the build logging started but it doesn't seem to actually have any design time build related logs.

  6. Gnbrkm41 commented on May 14, 2020

    @Gnbrkm41
    ContributorAuthor

    Actually... this is the full log that's being shown when I try to load the project:

    C:\Users\gotos\source\repos\runtime\src\coreclr\src\System.Private.CoreLib\System.Private.CoreLib.csproj : error  : The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found.
    
    Detailed Information:
    Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
    
    Project "C:\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems" was not imported by "C:\Users\gotos\source\repos\runtime\src\coreclr\src\System.Private.CoreLib\System.Private.CoreLib.csproj" at (384,3), due to the file not existing.
    
    Project "C:\Users\gotos\source\repos\runtime\src\coreclr\src\System.Private.CoreLib\codeOptimization.targets" was not imported by "C:\Users\gotos\source\repos\runtime\src\coreclr\src\System.Private.CoreLib\System.Private.CoreLib.csproj" at (401,3), due to the file not existing.
    
    

    Could it be because of the SDK missing? and if so why does it think it is missing, when it's clearly inside the .dotnet folder?

  7. ViktorHofer commented on May 14, 2020

    @ViktorHofer
    Member

    When you open a project inside VS, the globally installed SDK is used. Ideally we would want VS to tell to not use that one but there is currently no hook to do so.

    The minimum required SDK version is specified here: https://github.com/dotnet/runtime/blob/master/global.json#L3. This is documented here: https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/windows-requirements.md#net-sdk. You can find the download links for the required SDK version here: https://github.com/dotnet/installer#installers-and-binaries.

    For Windows, https://aka.ms/dotnet/net5/preview5/Sdk/dotnet-sdk-win-x64.exe should suffice.

  8. Gnbrkm41 commented on May 14, 2020

    @Gnbrkm41
    ContributorAuthor

    Installing the SDK globally indeed solves the problem. 👍

    I wish the document was updated to be more accurate about it though, for me it sounds like it's only necessary if you want to run and build apps via the normal dotnet way. It doesn't mention it's also required if you want to open solution files with VS... and I was not expecting this to happen because it "just worked" without global installations before (or could be that I had late enough SDK already globally installed).

    P.S. the aka.ms link doesn't seem to work? I know the other links point to the same thing but >.>

  9. ViktorHofer commented on May 14, 2020

    @ViktorHofer
    Member

    and I was not expecting this to happen because it "just worked" without global installations before (or could be that I had late enough SDK already globally installed)

    Yes that was probably the case. VS always used the globally installed SDK.

    I wish the document was updated to be more accurate about it though, for me it sounds like it's only necessary if you want to run and build apps via the normal dotnet way. It doesn't mention it's also required if you want to open solution files with VS...

    Great feedback :) Would you mind submitting a PR to make this clearer and correct the aka.ms link and point to https://github.com/dotnet/installer#installers-and-binaries instead?

  10. Gnbrkm41 commented on May 14, 2020

    @Gnbrkm41
    ContributorAuthor

    Would you mind submitting a PR to make this clearer

    Could do 🙂

    correct the aka.ms link

    No, I meant the link at the end of your last comment didn't work...

  11. ViktorHofer commented on May 14, 2020

    @ViktorHofer
    Member

    No, I meant the link at the end of your last comment didn't work...

    Oh I see. We just recently branched off for P5, that might be the reason. @dsplaisted are you aware of the dotnet/installer's P5 links not working correctly in the table? In example https://aka.ms/dotnet/net5/preview5/Sdk/dotnet-sdk-win-x64.exe.

    Could do 🙂

    Thanks :)

  12. changed the title [-]System.Private.CoreLib.csproj fails to load in System.Private.CoreLib.sln[/-] [+]System.Private.CoreLib.csproj fails to load in System.Private.CoreLib.sln without global installations of SDK[/+] on May 14, 2020
  13. changed the title [-]System.Private.CoreLib.csproj fails to load in System.Private.CoreLib.sln without global installations of SDK[/-] [+]System.Private.CoreLib.csproj fails to load in System.Private.CoreLib.sln without global installations of nightly SDK[/+] on May 14, 2020
  14. changed the title [-]System.Private.CoreLib.csproj fails to load in System.Private.CoreLib.sln without global installations of nightly SDK[/-] [+]System.Private.CoreLib.csproj fails to load in System.Private.CoreLib.sln without global installations of nightly/preview SDK[/+] on May 14, 2020
  15. dsplaisted commented on May 14, 2020

    @dsplaisted
    Member

    @dsplaisted are you aware of the dotnet/installer's P5 links not working correctly in the table?

    I think @bozturkMSFT and @wli3 are aware of this and working on it

  16. bekir-ozturk commented on May 14, 2020

    @bekir-ozturk
    Contributor

    @dsplaisted We don't seem to have a P5 branch in dotnet/installer yet. Do we have that task assigned to someone?

  17. dsplaisted commented on May 14, 2020

    @dsplaisted
    Member

    I think @sfoslund is the branch owner for preview 5.

  18. sfoslund commented on May 14, 2020

    @sfoslund
    Member

    It sounds like @mmitche will be handling setting up the preview branches.

  19. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Infrastructure-coreclrOnly use for closed issuesuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions