This is my first Visual Studio 2010 / SharePoint 2010 Visual Web Part, and my first use of NuGet, so forgive my blinding ignorance. fwiw, this is for SP2010. I'm asking here instead of at sharepoint.stackexchange because I suspect it's more a VS question.
In VS2010, I have a SP2010 Visual Web Part project. It debugs clean and shows a basic "Hello World!" as desired. Looking at VisualWebPart1UserControl.ascx.cs, I have
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
namespace VisualWebPartProject1.VisualWebPart1
{
public partial class VisualWebPart1UserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
SPSite site = SPContext.Current.Site;
SPSite.UsageInfo usage = site.Usage;
foo.Text = "Hello World!";
}
}
}
So far so good. Now what I really want to do on this page will involve some ugly date/time work, so I google, and discover a NuGet package, "TimePeriodLibrary.NET". I get NuGet config'd to work with VS2010, and I add the package to my project. I see the package refeerences added in References, great.
Problem comes when I try this:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Itenso.TimePeriod;
namespace VisualWebPartProject1.VisualWebPart1
{
public partial class VisualWebPart1UserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
SPSite site = SPContext.Current.Site;
SPSite.UsageInfo usage = site.Usage;
TimeRange timeRange1 = new TimeRange(
new DateTime(2011, 2, 22, 14, 0, 0),
new DateTime(2011, 2, 22, 18, 0, 0));
foo.Text = "TimeRange1: " + timeRange1;
}
}
}
It looks okay, but when I debug, I get:
"Could not load file or assembly 'Itenso.TimePeriod, Version=1.4.11.0, Culture=neutral, PublicKeyToken=d7f23b760ed5c748' or one of its dependencies. The system cannot find the file specified.":"Itenso.TimePeriod, Version=1.4.11.0, Culture=neutral, PublicKeyToken=d7f23b760ed5c748"
Being my first use of NuGet (amongst other firsts as you can tell), I was under the impression that it would modify web.config and basically 'make it work'. I've tried in desperation to even manually drag the needed .DLLs into the /BIN folder for the web application, but even that didn't work.
I'll admit it, I'm stumped. Any help would be appreciated.