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

Installation issue with project templates using NuGet wizard #34

Closed
dazinator opened this issue Dec 24, 2015 · 0 comments
Closed

Installation issue with project templates using NuGet wizard #34

dazinator opened this issue Dec 24, 2015 · 0 comments
Labels

Comments

@dazinator
Copy link
Owner

When creating a VS project system or a VS project template, you can use the NuGet wizard with your project template to "pre-install" NuGet packages with your project when its created in VS via "Add New Project" dialog.

When this is done to "pre-install" DnnPackager NuGet package with a new project there is a strange error.

Theinstall.ps1 script inside the NuGet package is executed, and uses this technique to access the msbuild project, so that it can then import the additional targets to the project, however the current project is not in the LoadedProjects collection in this scenario. Therefore the install script errors.

I can only assume that NuGet is executing the install.ps1 script before the project has been fully loaded - which might make sense as its in the process of being created still perhaps.

The solution would be to amend the install.ps1 script, so that if the project is not yet in the loaded projects collection, it listens for the "ProjectAdded" event (on the ProjectCollection object) signalling that the project has finished loading, and then installs the targets!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant