Skip to content

Clean target should clean the assets file generated by restore #4476

Open

Description

@rohit21agrawal

calling msbuild /t:clean on a project should delete the project.assets.json file and *.g.props and *.g.targets file from the obj folder of a project.

Activity

  1. emgarten commented on Feb 2, 2017

    @emgarten
    Member

    I think just need to register these files under a property to allow them to be cleaned. I'm not sure that we want these to be part of clean however, it would make /t:Clean equivalent to uninstalling the .NET framework for core projects.

  2. added this to the milestone on Feb 8, 2017
  3. modified the milestones: Future-0, Backlog on Nov 10, 2017
  4. added
    Priority:2
    on Nov 10, 2017
  5. Deepscorn commented on Mar 31, 2020

    @Deepscorn

    There should be a way to clean. While I see removing project.assets.json is not recommended (see #7368 (comment)), there should be a supported way to clean every cache.

    PS My team is experiencing #7368 because of switching git branches so that dotnet & TargetFramework versions go up & down.
    error NETSDK1005: Assets file '/Users/admin/dev/dev/dev/workspace/scm-bundles/Toolset/edart/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v3.0'. Ensure that restore has run and that you have included 'netcoreapp3.0' in the TargetFrameworks for your project. [/Users/admin/dev/dev/dev/workspace/scm-bundles/Toolset/edart/edart.csproj]
    (project.assets.json is not refreshed and that's the source of the problem)

    And we are using workaround dotnet/project-system#3164 (comment) with manually cleaning obj & bin, risking to encounter another problems, like described here dotnet/project-system#3164 (comment)
    (restore PackageReferences fails)

  6. added
    Priority:3
    and removed
    Priority:2
    on Dec 2, 2021
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

    Functionality:RestorePriority:3Triage:InvestigateType:Bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions