Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project.assets.json should be under Configuration specific folder within intermediate path #5297

Closed
attilah opened this issue May 30, 2017 · 3 comments
Labels
Functionality:Restore Priority:2 Issues for the current backlog. Type:DCR Design Change Request
Milestone

Comments

@attilah
Copy link

attilah commented May 30, 2017

In Orleans I just discovered a weird issue: in the nuspec the project references for our Release packages pointed to 1.5.0-dev instead of 1.5.0. We're using only suffixes for Debug builds.

It turned out that since we only did a package restore (like in the old days) at the beginning of the build once, project.assets.json got the version suffix burned in, since the first build was Debug.

Because of this an invalid package reference was generated for the projects.

If the project.assets.json would go under obj\Debug together with the generated props and targets file this situation would not happen.

Portion of our Directory.Build.props file:

  <!-- For Debug builds generated a date/time dependent version suffix -->
  <PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
    <VersionSuffix Condition=" '$(VersionSuffix)'=='' ">dev</VersionSuffix>
    <VersionSuffix Condition=" '$(VersionDateSuffix)'!='' ">$(VersionSuffix)-$(VersionDateSuffix)</VersionSuffix>
  </PropertyGroup>
@attilah attilah changed the title project.assets.json should be under Configuration folder within intermediate path project.assets.json should be under Configuration specific folder within intermediate path May 30, 2017
@sstevenkang
Copy link

I have this issue open that's related. https://github.com/dotnet/cli/issues/7686

Before 2.0, doing a dotnet restore would overwrite existing project.assets.json. In 2.0, you need to pass in -f to force rewriting of the file.

In our case, we also need to have the file placed under a directory with target framework. I think it should follow how other generated files are placed: /obj/<configuration>/<target framework>/project.assets.json.

@mishra14 mishra14 added Type:DCR Design Change Request Functionality:Restore labels Nov 29, 2017
@mishra14 mishra14 added this to the Backlog milestone Nov 29, 2017
@mishra14 mishra14 added the Priority:2 Issues for the current backlog. label Nov 29, 2017
@mishra14
Copy link
Contributor

@sstevenkang looking at dotnet/cli#7686, you are facing this problem because you have 2 different csproj files in the same folder, which is unsupported.
But you can workaround this by adding a --Force to the restore calls which will result in rewriting of the assets file each time.

@mishra14
Copy link
Contributor

duping this in the favor of #5421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Priority:2 Issues for the current backlog. Type:DCR Design Change Request
Projects
None yet
Development

No branches or pull requests

3 participants