Testing a package that adds a command to PM Console

Aug 12, 2011 at 1:19 PM

Hi,

I am trying to add a command to an existing internal NuGet package. The initial development went well and I want to enhance that version to make it a bit slicker!

However, the testing process seems somewhat long-winded ie uninstall the package, close Solution, close VS, re-opend VS, Re-load the solution and re-install the package.

Does anyone have any tips on how to make this process a little easier?

 

Thanks,

James

Aug 14, 2011 at 2:49 PM

Why uninstall isn't enough? I would like to know because I am also preparing package and have many weird problems.

Aug 14, 2011 at 4:03 PM

It's most likely a powershell thing. You need to remove the existing module before importing the new one with the same name.

Let me see if I can find an example for you.

____
Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

Aug 14, 2011 at 4:11 PM

https://github.com/JamesKovacs/psake/blob/master/psake.ps1#L26

Notice that you import a module by name.psm1 file, but you remove the module only by name.
____
Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

Aug 15, 2011 at 1:01 PM

Oh dear.....

I have managed to get the testing process down to just deploy-> install -> test -> uninstall -> deploy....

I don't need to close VS! I had the following code;

function Publish-CreateFolder999($chosenDir, $attemptLetter) {
  ...
}

Export-ModuleMember Publish-CreateFolder

So I was changing the function name, but not the name in the Export-ModultMember command.

Thanks for all the suggestions. Sorry guys!!

Developer
Aug 15, 2011 at 6:03 PM

You'd need to close VS if you loaded some helper assembly :), but that doesn't look like the case.