Re: Adding install-time behavior to core

Apr 18, 2011 at 12:10 PM
well, better not. Core doesn't depend on VS at all (which is good). will think of something else (maybe a linked file or something).

/kzu

--
Daniel Cazzulino | Developer Lead | MS MVP | Clarius Consulting | +1 425.329.3471


On Mon, Apr 18, 2011 at 09:09, Daniel Cazzulino <kzu@clariusconsulting.net> wrote:
the only thing in common between the VisualStudio and the PowerShellCmdlets is Core :(. so I guess it'll have to go there.

/kzu

--
Daniel Cazzulino | Developer Lead | MS MVP | Clarius Consulting | +1 425.329.3471


On Mon, Apr 18, 2011 at 08:44, Daniel Cazzulino <kzu@clariusconsulting.net> wrote:
From the powershell host, the code path is different too :(. The init/install script is run from

- ProcessPackageBaseCommand.OnPackageReferenceAdded

Anyway, kinda weird.
I'll put my code in a separate class and add the call to it from all three places, I guess.

/kzu

--
Daniel Cazzulino | Developer Lead | MS MVP | Clarius Consulting | +1 425.329.3471


On Mon, Apr 18, 2011 at 08:27, Daniel Cazzulino <kzu@clariusconsulting.net> wrote:
I'm giving Add Import during package install a shot and found that there are a couple places/code-paths (so far) that perform the Install script execution, and I don't know where I should be putting my logic:

InstalledHandler:
- VsPackageManager.RunSolutionAction
- PackagesProviderBase.OnPackageInstalled (runs Install scripts)
- VsPackageInstaller.InstallPackage (also runs Install scripts :S)

I first placed my code in the last one, which was the first I found, and when it never hit the breakpoints, I learned about the other code path that goes to PackagesProviderBase :(.

So, two questions:
- When is VsPackageInstaller.InstallPackage called? Is this legacy code?
- Should I put the behavior in the PackagesProviderBase? This seems weird as the class is within the PackageManagerUI folder and I certainly want the behavior to trigger also for console-installed packages...


Thanks in advance.

/kzu

--
Daniel Cazzulino | Developer Lead | MS MVP | Clarius Consulting | +1 425.329.3471



Apr 18, 2011 at 2:49 PM

Can you reply to the same thread? And please empty the message before replying.

If you want to add Import during package install, you only need to do so when package is installed into a project (when install.ps1 is executed). You don't need to do it at solution level (when init.ps1 is executed).

For that, you'll do it in two places: PackageProviderBase (for the dialog) and ProcessPackageBaseCommand (for the console).

 

Apr 18, 2011 at 3:09 PM

On Mon, Apr 18, 2011 at 11:50, dotnetjunky <notifications@codeplex.com> wrote:

From: dotnetjunky

Can you reply to the same thread?

ok

And please empty the message before replying.

Doing work for machines is way boring. It's about time someone fixes that in Codeplex.

If you want to add Import during package install, you only need to do so when package is installed into a project (when install.ps1 is executed). You don't need to do it at solution level (when init.ps1 is executed).

For that, you'll do it in two places: PackageProviderBase (for the dialog) and ProcessPackageBaseCommand (for the console).

Cool, thanks.

Read the full discussion online.

To add a post to this discussion, reply to this email (nuget@discussions.codeplex.com)

To start a new discussion for this project, email nuget@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com