dotnet / test-templates

MIT License
45 stars 72 forks source link

Templates create compile errors in solutions with Central Package Management (CPM) #300

Open cremor opened 1 year ago

cremor commented 1 year ago
  1. Create or open a solution with Central Package Management (CPM)
  2. Add a new test project via one of the test project templates.
  3. Notice that there are compile errors. The root error is NU1008 Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items

Related: dotnet/aspnetcore#48569

Evangelink commented 1 year ago

Marking as blocked just to wait for guidance as to what's the right way to fix it.

cremor commented 1 year ago

See https://github.com/dotnet/templating/issues/6187#issuecomment-1572223281

Evangelink commented 10 months ago

@YuliiaKovalova Do you think we should start working on this for test templates or shall we wait for the more global solution to be provided by your team (as specified in this comment https://github.com/dotnet/templating/issues/6187#issuecomment-1802984724)?

YuliiaKovalova commented 10 months ago

@YuliiaKovalova Do you think we should start working on this for test templates or shall we wait for the more global solution to be provided by your team (as specified in this comment dotnet/templating#6187 (comment))?

TE was transferred to the different team. @baronfel please advise here.

baronfel commented 10 months ago

@Evangelink the template engine is owned by the SDK team now, specifically @MiYanni and @joeloff are the engineering owners. I would recommend you implement the workaround from 6187 with the following addition: add --no-restore to the call to dotnet add package for each package you add. This will prevent a large amount of overhead. Instead, you can do a final restore PostAction like many templates do today at the end of the package additions.

Evangelink commented 10 months ago

Thank you @YuliiaKovalova and @baronfel. I'll schedule that.

Evangelink commented 9 months ago

@cvpoienaru please help here.