Is there a problem with Nuget Package?

Topics: Getting Started
Sep 14, 2012 at 9:02 PM

Hello,

I have just created a new Windows Phone Application, targeting the "Windows Phone OS 7.1" and then I try to install the Nuget Package for Caliburn.Micro.

The installation succeeds successfully, and I can see this in the Package Manager Console:

PM> Install-Package Caliburn.Micro

Successfully installed 'Caliburn.Micro 1.3.1'.

Successfully added 'Caliburn.Micro 1.3.1' to Demo 1 - Blank Project.

However, when I check the project, I don't see what I would expect, i.e. the AppBootStrapper.cs and the MainPageViewModel.cs added to the Project.

I am almost convinced that this used to happen.

Did I miss something?  Or does this not happen anymore?

Thanks

Gary

Sep 15, 2012 at 3:35 PM

Hello, I don't think that happens in v1.3.1 but you could easily create those classes yourself...the instructions are in the documentation section.

- Regards

Sep 15, 2012 at 3:43 PM

Hello,

Thanks for the reply, but I am slightly confused by the response?!?

Are you saying that you don't think that the 1.3.1. version of the Nuget Package for Caliburn.Micro no longer adds the items to the project?

That surprises me a lot, especially since on inspecting the package, it certainly looks as though it is meant to.  For instance, the AppBootStrapper.cs and the MainPageViewModel.cs are both available within the package folder, and also the install.ps1 contains the following:

param($rootPath, $toolsPath, $package, $project)

function get-content-path($contentRoot) {
	$moniker = $project.Properties.Item("TargetFrameworkMoniker").Value
	$frameworkname = new-object System.Runtime.Versioning.FrameworkName($moniker)

	$id = $frameworkname.Identifier

	if($id -eq ".NETFramework") { $relative = "net40" }
	elseif($id -eq "Silverlight" -and $frameworkname.Profile -eq "WindowsPhone71") { $relative = "sl4-windowsphone71" }
	elseif($id -eq "Silverlight" ) { $relative = "sl4" }
 
	[System.IO.Path]::Combine($contentRoot, $relative)
}
 
$contentSource = get-content-path($rootPath + "\tools")
$defaultNamespace = $project.Properties.Item("DefaultNamespace").Value

ls $contentSource | foreach-object { 
	$content = [System.IO.File]::ReadAllText($_.FullName)
	$content = $content.Replace('$safeprojectname$', $defaultNamespace)
	$content | out-file -Encoding UTF8 $_.FullName
	$project.ProjectItems.AddFromFileCopy($_.FullName)
}

$project.DTE.ItemOperations.Navigate('http://caliburnmicro.codeplex.com/wikipage?title=Nuget')

Which, if I have read it properly, certainly looks as though it is meant to alter the namespace within each of those files, and then add them to the project.

It is almost as though the install.ps1 file is not getting called?!?

Anyone got any ideas?

I know you "can" deploy these files manually, but I am away to be giving a presentation on Caliburn.Micro, and I want to make sure that I am giving the audience the best information.

Gary

Sep 15, 2012 at 4:35 PM

Yeah, you're right...I never noticed that before. But in my projects, nothing is ever created for me.

Sep 15, 2012 at 4:37 PM

Out of interest, how long have you been using Caliburn.Micro?

This definitely used to work, so I am starting to wonder whether this is an issue with the upgrade for the Windows Phone SDK (i.e. 7.1.1) or whether an upgrade to Nuget is stopping this package from working as it was before.

Really hoping that Rob, or one of the other Project Members can provide some input on this.

Gary

Sep 15, 2012 at 8:50 PM

I have just installed Caliburn.Micro 1.3.1 from Nuget and it will not add any files to the project, e.g. AppBootStrapper.cs ,MainPageViewModel.cs 

Not a good start...

 

// Anders

Sep 16, 2012 at 9:52 AM

NuGet 2.0 breaks the way how these files where installed by the caliburn package.
At the moment you have to add these files manually to your project. They are still part of the nuget package but does not get installed automatically.
Just navigate to the caliburn micro folder inside the packages folder of your project. The files are located inside the tools subfolder.

In the latest sources this issue is already fixed (see http://caliburnmicro.codeplex.com/workitem/237).

Also the package is now split:

  • Caliburn.Micro only contains the binaries
  • Caliburn.Micro.Start containes the bootstrapper, shellview and shellviewmodel

 

A new caliburn release is pending. Rob is just waiting for the last WinRT issues to get fixed.
Hope this helps.

Sep 16, 2012 at 5:37 PM
andis59 wrote:

I have just installed Caliburn.Micro 1.3.1 from Nuget and it will not add any files to the project, e.g. AppBootStrapper.cs ,MainPageViewModel.cs 

Not a good start...

 

// Anders

Yes, this is the same problem that I was referring to.

Gary

Sep 16, 2012 at 5:39 PM
tibel wrote:

NuGet 2.0 breaks the way how these files where installed by the caliburn package.
At the moment you have to add these files manually to your project. They are still part of the nuget package but does not get installed automatically.
Just navigate to the caliburn micro folder inside the packages folder of your project. The files are located inside the tools subfolder.

In the latest sources this issue is already fixed (see http://caliburnmicro.codeplex.com/workitem/237).

Also the package is now split:

  • Caliburn.Micro only contains the binaries
  • Caliburn.Micro.Start containes the bootstrapper, shellview and shellviewmodel

 

A new caliburn release is pending. Rob is just waiting for the last WinRT issues to get fixed.
Hope this helps.

Tiblel,

This is great news!

In order to build the current source, in order to get a working Nuget package, I take it I would have to have Visual Studio 2012 installed, is that correct?

I don't have my rig set up with that yet :-(  Would you be in a position to create a working Nuget package for me?  I am doing a presentation on Caliburn.Micro at the middle of October, and I want to create a number of demos for it, so it would be great to have a working Nuget package.

The idea of splitting the Nuget packages out is a great one!

Gary

Oct 4, 2012 at 8:07 AM

Hello,

Can someone point me in the direction of what I need to do in order to compile and use the current source code?

I have downloaded the latest code, opened and built the Caliburn.Micro.sln, opened and built the Caliburn.Micro.PackageBuilder.sln, and had a hunt through all the resulting folders, but I can't see anything that looks like the packages that you mention above.

What trick am I missing?

Thanks

Gary

Oct 5, 2012 at 5:13 PM

You have to do the following:

  • build src\Caliburn.Micro.sln
  • build src\Caliburn.Micro.WinRT.sln (if you want WinRT assemblies too)
  • run nuget\create-packages.ps1 (this will create the nuget packages)

That's all :-)

Oct 6, 2012 at 2:42 PM

Hello tibel,

Thanks again for all your help!

I actually found the create-packages.ps1 file not long after posting the question.  I guess the confusion was that there is actually another solution, called Caliburn.Micro.PackageBuilder.sln, which seems to do the work of building:

  • Caliburn.Micro.Container
  • Caliburn.Micro.EventAggregator
  • Caliburn.Micro.INPC

Why is this logic wrapped up in another Visual Studio Project, and some in a PowerShell script?

Thanks!

Gary