-
Notifications
You must be signed in to change notification settings - Fork 377
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
Restore postAction does not work when primaryOutputs renamed with sourceName #2068
Comments
I'm having the same issue.
@sayedihashimi is there a workaround for this? Looking to see if I could contribute a fix, but still learning the code. It looks like right about here the restore process needs to account for the provided name replacing sourceName. templating/src/Microsoft.TemplateEngine.Cli/PostActionProcessors/DotnetRestorePostActionProcessor.cs Line 107 in e92ed67
|
Try using forward slashes as path separators instead of windows style separators. There appears to be an issue with mapping the source renames in primary outputs which use windows path separators. |
Hello @davidortinau , how did it go with phenning's work around? |
The workaround works well for my test templates. I normalized primary outputs so they should start to work with backslashes as path separators also. I am closing the issue, it seems nothing more should be done on that. Please do not hesitate to reopen the issue if anything comes up. |
My template includes 3 projects:
I am utilizing the "sourceName" property of the template.json to rename these to whatever name is passed into
dotnet new
, and I want to run restore on all 3 of the projects to restore nuget packages. My template.json looks something like this:When I install the template and run
dotnet new mytemplate -n A.Project.Name
I get all 3 projects in the correct folders with the names I expect (.\src\A.Project.Name.csproj, .\test\integration\A.Project.Name.Test.Integration.csproj, .\src\A.Project.Name.Test.Unit.csproj), and it does attempt to run the restore post action for each project, but it fails because it's trying to restore the actual names that are in my primary outputs. It is trying to restore src\My.Project.csproj, which obviously does not exist because it was renamed to src\A.Project.Name.csprojThe text was updated successfully, but these errors were encountered: