.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

new SPSite("http://site") gives System.IO.FileNotFoundException

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :SharePoint


A colleague of mine has developed a functioning console application that simply performs a little search using an SPQuery object.

I've created a web service to be called by BDC to do this.

My web service code fails here:

   using (SPSite site = new SPSite("http://sharepointapp01/sandbox"))


When I attempt to execute the method from a web browser, I get this:


View Complete Post

More Related Resource Links

System.IO.FileNotFOundException when trying to doing new SPSite("http://plop.com") request


Hi everyone,

I'm currently trying to develop an WCF that must access to a site collection. For debugging, I'm currently running the wcf into an asp.net development server.

But I get a problem when trying to make the new SPSite object to an existing site collection. I get a System.IO.FileNotFound exception from SharePoint.

As I read on different blog post, it seems to comes from a sql right access problem. But I don't know how to configure it to be able to correct this problem.

Could anyone help me please?

Thanks a lot.


System.IO.FileNotFoundException: Could not load file or assembly 'System.EnterpriseServices

Hi, I am getting the following error with a WPF/C# application on one of the machines that we run the application on. The application works fine on other machines. I compared the "System.EnterpriseServices.dll" file on the machine that throws the error with the dll file on the machine that works fine. I did not any differences. We are using .NET 4 (client profile) framework on XP/x86. Can someone please provide some clue as to why the error is thrown on one of the machines? System.IO.FileNotFoundException: Could not load file or assembly 'System.EnterpriseServices, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.EnterpriseServices, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'    at System.Data.Common.ADP.IsSysTxEqualSysEsTransaction()    at System.Data.Common.ADP.NeedManualEnlistment()    at System.Data.OleDb.OleDbConnection.Open()    at TDS.MainWindow.initializeDB(String fileWithPath) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the

SharePoint 2010 : Creating SPSite object throws exception FileNotFoundException

We are in a process of upgrading from SharePoint 2007 to SharePoint 2010. I had written a Service which runs under default web site on the SharePoint web server. This service's app pool account uses the farm admin account. The service was working with no issue on SharePoint 2007 x64bit server. When I installed and run the same service on SharePoint 2010 x64bit box. I get the FileNotFoundException on SPSite site = new SPSite(http://myserver/sites/projects/project01); I have given the pool account running this server following rights: The Farm Admin The Site Collection Admin The Database Sys Admin The Local Admin No Luck. Thank you in advance for your help.

Sharepoint & SSRS 2008 "System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft


my environment as below:

1- SERVER A (SQL server DB 2008 sp1)
2- Server A (SSRS 2008 sp)
3- SERVER B MOSS 2007 sp1
I configured the SSRS to be sharepoint intergated mode but when i  hit the Web Service URL i got the error below:

Reporting Services Error

  • The configuration parameter SharePointIntegrated is set to True but Share Point Object Model cannot be loaded. The error was: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c' at Microsoft.ReportingServices.SharePoint.Server.SharePointServiceHelper..ctor() at Microsoft.ReportingServices.SharePoint.Server.SharePointServiceHelperFactory.get_ServiceHelper() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. . (rsSharePointObjectModelNotInstalled)

    System.IO.FileNotFoundException: File not found.


    While developing a app that makes calls to a network share I have come across a menu item that works if I go to START\RUN then put in the network share address from a client machine; however if I put that link into the app I've created to pull that particular application I get the below error (FileNotFoundException).  What I dont understand is the application that Ive created has approximately 70 menu choices, all of which work except for 2 applications.  Each application has the identical error. 

    Why, if I appempt to run the application through the start\run service on my machine does it execute properly but it doesn't if I run it through the application interface?  The other 68 applications run fine through the interface.

    Im using VS2010 on my development machine and my client machine is running  Windows 7


    ************** Exception Text **************

       at Microsoft.VisualBasic.Interaction.Shell(String PathName, AppWinStyle Style, Boolean Wait, Int32 Timeout)
       at XXXXX_Menu.Module1.SyncShellCmd(String& CmdStr, Int32& ApplicationFocus)
       at XXXXX_Menu.Form1.ListView5_MouseDoubleClick(Object sender, MouseEventArgs e)
       at System.Windows.Forms.Control.OnMouseDoubleClick(MouseEventArgs e)
       at System.Windows.Forms.ListView

System.IO.FileNotFoundException: The Web application



I have a webservice method that should create a web part. However, the code gives the below error. But the URL is actually correct!

System.IO.FileNotFoundException: The Web application at https://mysite.com/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

Here is my code...

    public void CreateTempWebPart(string ClientName)
      // check registry for site url
      string URL = @"https://mysite.com/" + ClientName;

        using (SPSite spSiteTest = new SPSite(URL))
          SPWeb web = spSiteTest.OpenWeb();
          web.AllowUnsafeUpdates = true;

          using (SPWeb spWebTest = spSiteTest.OpenWeb())

System Development Life Cycle

The Systems Development Life Cycle (SDLC) is a conceptual model used in project management that describes the stages involved in an information system development project from an initial feasibility study through maintenance of the completed application. Various SDLC methodologies have been developed to guide the processes involved including the waterfall model (the original SDLC method), rapid application development (RAD), joint application development (JAD), the fountain model and the spiral model. Mostly, several models are combined into some sort of hybrid methodology

The Agile System Development Life Cycle (SDLC)

The goal of this article is to describe the agile system development life cycle (SDLC), putting it in context from what you may have heard about within the agile community and more importantly within the context of your overall IT efforts.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.



hello i have the following problem

i have upload my content to hosting server but i get the following error

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: Request for the permission of typ

Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPerm


Good Day all,

Having an issue with an outside user accessing my IIS7 box. I do not have this problem when running the website from my host machine. I found this post: Http://forums.asp.net/t/1371394.aspx. I assure you that this is not a solution because I am not storing any of my files on a network share. 

What do you think my approach should be. 

I already have read rights to IIS user to my BIN folder. 

Thanks for the help. 

System.IO.Packaging is not visible


I am new to ASP.net, I installed VS2005 and IIS 5 on my PC and set up my first website using IIS (not the embedded webserver in VS).

For some reason I cannot find the Assembly: "System.IO.Packaging", please let me know if I am allowed to use it in that medium and how can I reference it?

Thanks in advance.

how i can install sql server in my system


which edition of sql server  are best for me  Developer edition or express editon for development purpose.

i try to install last time sql server in my system but not successful so what i do for get the sql server in my system.

The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must



This is frustrating, and I don't know how to solve it.

I have a strange problem. I am adding a LinqDatasource object, and set the context:

        protected void LinqDataSource_ContextCreating(object sender, LinqDataSourceContextEventArgs e)
            e.ObjectInstance = new KaruselaDataContext(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

Then I get this error:
The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.


On web.config I already have this:
<add assembly="System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

NOTE: The datacontext is in a different project (DLL proect) where I added a refernce to System.Data.Linq.

is there another way adding a refernce to a web project? or only though teh web.config?


System.Xml.Linq.XElement and XPathDocument


I have an XPathDocument that I want to save to a table using LINQ, but I get this error

cannot implicitly convert type 'System.Xml.XPath.XPathDocument' to 'System.Xml.Linq.XElement'

I create the XPathDocument from some (valid) xml contained in a resource file

XPathDocument xDoc = new XPathDocument(new StringReader(Resource1.TestXML));

when I try to assign it with LINQ, it flags up an error

NewDataItem.XML = xDoc  ----  error here

NewDataitem is a LINQ to SQL object created from the underlying table, 'NewDataItem.XML' is a column type of 'XML'

how do i (easily) convert xDoc so I can pass it into the LINQ object ?

I want Er Diagram for Fees System of small institution ,can u plz guide me what fields are necessary


I want Er Diagram for Fees System of small institution ,can u plz guide me what fields are necessary to store Fees information ...


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend