Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8717543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:19:42+00:00 2026-06-13T06:19:42+00:00

This is my first Visual Studio 2010 / SharePoint 2010 Visual Web Part, and

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:19:44+00:00Added an answer on June 13, 2026 at 6:19 am

    I hate answering my own questions, but I did get it to work.
    http://jussionsharepoint.com/index.php/2012/02/08/using-global-assembly-cache-tool-gacutil-exe-effectively/
    I located the .dll, and used gacutil.exe /i to install it to the GAC. Thereafter, everything worked as desired. I can’t say authoratatively that this is the “right” way to get the desired results, but it appears to be so. I’m open to any wisdom the community wishes to pass along, should this not be the best way of getting it to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a visual web part in visual studio for sharepoint 2010. The whole
We are using Visual Studio 2010, but this was first conceived with VS2003. I
I have created my first website in Visual Studio 2010 Professional. In the web
I'm using Visual Studio 2012 for Windows Phone 7 and this is my first
I want to write my first Visual Studio 2010 add-in. My aim is to
Using Visual Studio 2010, I developed a WCF service hosted on a web application
I fired up my first asp.net 4 app put together with visual studio 2010
I am trying my hands on Visual Studio 2010 (Asp.Net 4.0) for the first
First off, I'm using Visual Studio 2010, Measurement Studio 2010 plugin , C# and
note: First of all i am using visual studio 2010. Usually i need dll

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.