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

  • Home
  • SEARCH
  • 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 9016319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:58:02+00:00 2026-06-16T03:58:02+00:00

We have a mixed (forms and Windows)-based SharePoint 2010 site and I’m attempting to

  • 0

We have a mixed (forms and Windows)-based SharePoint 2010 site and I’m attempting to use the object model in c# (command line console app, referenced to Microsoft.SharePoint, Solution Platform target is x64 [in VS 2012 I had to create a new solution platform, settings copied from <Empty>].)

In PowerShell, I can simply do something like

$site = Get-SPSite http://www.server.com/sites/site1

It successfully retrieves the object, and I can open the contained SPWebs, etc. as I please. However, when I attempt similar logic in C# (on the same box under the same user credentials) like

using(SPSite site = new SPSite("http://www.server.com/sites/site1") { }

it fails with the FileNotFoundException. Any attempts to use the associated Guids follow the same issue. Why might this be happening?

Also, I am an administrator on the box and also explicitly have sysadmin server role on the database.

  • 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-16T03:58:04+00:00Added an answer on June 16, 2026 at 3:58 am

    For anyone experiencing this as well. PowerShell 3 does not support SharePoint methods. I discovered after installing Powershell v3 that I had to enter another shell using the command powershell -version 2 first before running SharePoint commands, which led me to realize that my VS project was targeting .NET 4.5; Once I changed it to .NET 3.5, everything worked.

    I assume that despite the SharePoint libraries targeting .NET 3.5, and theoretically the .NET 4 CLR can handle .NET 2 CLR libraries, Projects with usage of SharePoint 2010 do not support targeting .NET 4/4.5 in any way.

    Happy to be proved wrong, of course 😉

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

Sidebar

Related Questions

I have an example mixed lmer model with 8 predictors and I want to
I have a Windows Forms application (.NET 4) that runs fine on my development
I have a WCF self-hosted service in a Windows Forms application. I am going
I sort of want to be able to do mixed windows and forms authentication.
I have mixed web application web forms & mvc2. At the moment i have
Is there a way to have simple windows authentication for a public facing site
I have a mixed MVC and Web Forms environment that works just fine in
I have many sites under one ASP.NET forms authentication. They have mixed frameworks (some
we have a mixed development environment using ASP.NET MVC and Ruby on Rails. We
I have a mixed mode C++-CLI program in Visual Studio 2005 that is set

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.