{"action":"created","issue":{"url":"https://api.github.com/repos/ligershark/side-waffle/issues/172","labels_url":"https://api.github.com/repos/ligershark/side-waffle/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/ligershark/side-waffle/issues/172/comments","events_url":"https://api.github.com/repos/ligershark/side-waffle/issues/172/events","html_url":"https://github.com/ligershark/side-waffle/issues/172","id":41573241,"number":172,"title":"Proper support for nuget packages","user":{"login":"sayedihashimi","id":1283154,"avatar_url":"https://avatars.githubusercontent.com/u/1283154?v=3","gravatar_id":"","url":"https://api.github.com/users/sayedihashimi","html_url":"https://github.com/sayedihashimi","followers_url":"https://api.github.com/users/sayedihashimi/followers","following_url":"https://api.github.com/users/sayedihashimi/following{/other_user}","gists_url":"https://api.github.com/users/sayedihashimi/gists{/gist_id}","starred_url":"https://api.github.com/users/sayedihashimi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sayedihashimi/subscriptions","organizations_url":"https://api.github.com/users/sayedihashimi/orgs","repos_url":"https://api.github.com/users/sayedihashimi/repos","events_url":"https://api.github.com/users/sayedihashimi/events{/privacy}","received_events_url":"https://api.github.com/users/sayedihashimi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ligershark/side-waffle/labels/build-related","name":"build-related","color":"5319e7"},{"url":"https://api.github.com/repos/ligershark/side-waffle/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/ligershark/side-waffle/labels/help%20wanted","name":"help wanted","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ligershark/side-waffle/milestones/1","html_url":"https://github.com/ligershark/side-waffle/milestones/1.0","labels_url":"https://api.github.com/repos/ligershark/side-waffle/milestones/1/labels","id":442066,"number":1,"title":"1.0","description":"The initial non-beta release of SideWaffle.","creator":{"login":"sayedihashimi","id":1283154,"avatar_url":"https://avatars.githubusercontent.com/u/1283154?v=3","gravatar_id":"","url":"https://api.github.com/users/sayedihashimi","html_url":"https://github.com/sayedihashimi","followers_url":"https://api.github.com/users/sayedihashimi/followers","following_url":"https://api.github.com/users/sayedihashimi/following{/other_user}","gists_url":"https://api.github.com/users/sayedihashimi/gists{/gist_id}","starred_url":"https://api.github.com/users/sayedihashimi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sayedihashimi/subscriptions","organizations_url":"https://api.github.com/users/sayedihashimi/orgs","repos_url":"https://api.github.com/users/sayedihashimi/repos","events_url":"https://api.github.com/users/sayedihashimi/events{/privacy}","received_events_url":"https://api.github.com/users/sayedihashimi/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":43,"state":"open","created_at":"2013-10-01T03:40:01Z","updated_at":"2015-05-14T01:34:26Z","due_on":"2014-02-03T08:00:00Z","closed_at":null},"comments":10,"created_at":"2014-08-30T22:23:12Z","updated_at":"2015-06-29T17:20:06Z","closed_at":null,"body":"When a project template is added that uses NuGet packages there are two ways to get support for NuGet packages.\r\n\r\n 1. By manually changing the template to [support NuGet packages](http://docs.nuget.org/docs/reference/packages-in-visual-studio-templates)\r\n 1. Rely on package restore to restore packages\r\n\r\nThe first approach is the best way to go, but its too difficult so it's not used here. Instead most rely on the second approach. This works well if users have the packages folder at ```..\\packages```. If packages are stored in a different relative path then odds are the end user will get build errors. This is because in the .csproj file the ```Reference``` elements have a ```HintPath``` pointing to ```..\\packages```.\r\n\r\nTo remedy this I'm proposing the following. \r\n - [ ] Create a new custom wizard that can be used to change the ```HintPath``` value to the correct path to packages\r\n - [ ] Update build process to inject this new custom wizard into all the .vstemplate files during processing\r\n\r\nWhen the templates are installed the custom wizard will run and update the ```HintPath``` to the correct value for that project. We can also probably do this by updating the ```HintPath``` values in the .csproj on template creation to use a new template parameter, let's say $packageshintpath$. Then the custom wizard just populates that value."},"comment":{"url":"https://api.github.com/repos/ligershark/side-waffle/issues/comments/116767119","html_url":"https://github.com/ligershark/side-waffle/issues/172#issuecomment-116767119","issue_url":"https://api.github.com/repos/ligershark/side-waffle/issues/172","id":116767119,"user":{"login":"webwizgordon","id":8526030,"avatar_url":"https://avatars.githubusercontent.com/u/8526030?v=3","gravatar_id":"","url":"https://api.github.com/users/webwizgordon","html_url":"https://github.com/webwizgordon","followers_url":"https://api.github.com/users/webwizgordon/followers","following_url":"https://api.github.com/users/webwizgordon/following{/other_user}","gists_url":"https://api.github.com/users/webwizgordon/gists{/gist_id}","starred_url":"https://api.github.com/users/webwizgordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webwizgordon/subscriptions","organizations_url":"https://api.github.com/users/webwizgordon/orgs","repos_url":"https://api.github.com/users/webwizgordon/repos","events_url":"https://api.github.com/users/webwizgordon/events{/privacy}","received_events_url":"https://api.github.com/users/webwizgordon/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T17:20:06Z","updated_at":"2015-06-29T17:20:06Z","body":"@sayedihashimi \r\n\r\nI couldn't get `ls-ProjectTemplateFilesToRemoveOnCopy` to work as desired. I added\r\n```xml\r\n  <ItemGroup>\r\n    <ls-ProjectTemplateFilesToRemoveOnCopy Include=\"**\\packages\\**\\*\" />\r\n  </ItemGroup>\r\n```\r\nto template-builder.props and I could see the files listed from `GetFilesToExlucudeAsList()` while debugging [CreateTemplateTask.cs](https://github.com/ligershark/template-builder/blob/master/src/LigerShark.TemplateBuilder.Tasks/CreateTemplateTask.cs#L166).\r\n\r\nIt doesn't seem to have any effect though., It looks like the exclusion items are compared to the project items, and the packages folder and its contents aren't included as items. I also see that  `ls-ProjectTemplateFilesToRemoveOnCopy` by default includes \"_preprocess.xml\" (among others) but _preprocess.xml ends up being included the template, I assume because of the same reason of it not belonging to the sub-solution's project.\r\n\r\nMy current template build process is like this:\r\n\r\n1. Make changes to sub-solution containing projects to be exported as templates. Ensure solution compiles, test, etc.\r\n2. Clean sub-solution to free up obj/bin folder contents.\r\n3. Close sub-solution and delete its packages folder.\r\n4. Open template-building solution and build.\r\n5. Re-download packages next time changes are made to the sub-solution.\r\n\r\nI can probably add some build tasks to help with the deleting (though my MSBuild skill level is novice) prior to building templates but that still leaves me with restoring packages after. Ideally I'd like to configure TemplateBuilder to copy over only the project items instead of everything on disk.\r\n\r\nIn addition to packages, it also appears that the sub-project's obj & bin folder contents are copied into the template zips as well (though I don't believe VS actually uses them when creating a project from the template).\r\n\r\nMy VSIX is 30 MB if I don't delete the packages and obj/bin content first.\r\nIf I delete the packages, it drops down to 11 MB.\r\nIf I also clean the sub-solution first, it drops down to a much more reasonable 800 KB."}}