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

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

Microsoft.SharePoint.Client.File.OpenBinaryDirect - returns a 404 error if the file being requested

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :SharePoint
Hopefully someone can help with this. I'm using Sharepoint 2010. On the server I have manually created a folder in the "Shared Documents" folder called "bin" and uploaded a file into this folder If I attempt to access the files in this folder using the Microsoft.SharePoint.Client.File.OpenBinaryDirect function,  I receive the following error: A first chance exception of type 'System.Net.WebException' occurred in System.dll: System.Net.WebException: The remote server returned an error: (404) Not Found.    at System.Net.HttpWebRequest.GetResponse()    at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()    at Microsoft.SharePoint.Client.File.OpenBinaryDirect(ClientContext context, String serverRelativeUrl). Any other files in any other folders under the shared documents folder are accessible. Here is my example code: ClientContext clientCTX = new ClientContext(SPURL);             //Pass the credentials to the client context             clientCTX.Credentials = credentials;             List DeployFilesList = clientCTX.Web.Lists.GetByTitle("Shared Documents");             CamlQuery caml

View Complete Post

More Related Resource Links

Unable to open physical file - Operating system error 5: 5(error not found) Microsoft SQL Server: Er

I am trying to attach a database to SQL 2005. This database has not previously been attached. I have only just installed SQL.   I get the following message: Unable to open physical file "C:\ArrowSQL\Arr@Data\Arrow_data.mdf" Operating system error 5: "5(error not found)" (Microsoft SQL Server: Error 5120)".   I have loaded SQL and the database fiel and directory with the same user acccount which is a local adminstrator ont hsi machine. I have checked that I have read/write access to the file.   The machine runs Windows Vista Business. SQL has SP 2 loaded.   What causes this?

Framework error:Could not load file or assembly 'Microsoft.AnalysisServices, Version=

Hi,I use sql clr sp's to load data in to database using .net framework 2.0. I never had aproblem using this and it went well for months.I recently updated to net framework 3.5 sp1 and sqlserver sp3 on 32-bit sql server and win 2003.I am facing an error which i could not resolve.Error:System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AnalysisServices, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0x80131050)System.IO.FileLoadException:    at StoredProcedures.checktable(String paramComponent, String paramParameters)I have gone through different forums, and trie different options,but did not help. I am using 'unsafe'  option.I also tried to alter assembly which is mentioned in http://support.microsoft.com/kb/949080/pt But when i tried to alter the assembly using the above link or try to change the permission to external access on the assembly, i get the below error.Alter ASSEMBLY AccessibilityFROM 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Accessibility.dll'Cannot alter the assembly 'Accessibility', because it does not exist or you do not have permission.I am an admin on the server/sqlCan some one suggest how to alter assembly with permissions or solve this issue or am i missing anything important.Do i

Deleting the file from sharepoint folder gives error

Hi All, I am trying to delete a file from sharepoint it show error like this: <Result ID=\"1,Delete\" xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"><ErrorCode>0x80070005</ErrorCode><ErrorText>The operation failed because an unexpected error occurred. (Result Code: 0x80070005)</ErrorText>

File Not Found error sharepoint

Hi, I have downloaded two site templates from another site collection.I have uploaded these site templates to another site collection. Trying to Use these custom site templates in the current(another) site collection.When i click on create... i'm Getting "File Not Found" error.   Any Idea?

ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error

RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error Two Issues, apparently unrelated. I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library. 1. The below function is erroring with file not found, but I confirmed I'm sending the fully qualify path (i.e c:\test.txt) to System.IO.FileStream content = System.IO.File.Open(documentFileName, System.IO.FileMode.Open); 2. Even if it worked, looking at the code, I'm not using argument foldername.  I'm passing 20 to the argument. How can I make sure it uploads into subfolder 20 of ApplicantDocuments? Thank you.     Just testing in test environment. Will tighten code once it works.   public void UploadDocumentToSite(string foldername, string documentFileName) {      SPSite siteCollection = new SPSite("https://xxxxxx");      SPWeb web = siteCollection.OpenWeb();      //SPSite.AllowUnsafeUpdates = true;      //Web.AllowUnsafeUpdates = true;      string Lib = "ApplicantDocuments";      SPFolder destFolder = web.GetFolder(Lib);      sendmail(documentFileName+" "+foldername);  

Downloading a document from a sharepoint site to local file system, copy web service returns null

Hi Guys,
               I am trying to get this done for the last 2 days and I am still banging my head to the wall.
All I need to do is to download files from my sharepoint site library that uses integrated windows authentication. I was using copy webservice : getItem method to accomplish this.

CopyService.GetItem(copySource, out myFieldInfoArray, out myByteArray);

Problem : myByteArray is always returned as NULL

Note: I have tried the same with another site that uses forms authentication but the result was the same (NULL !!)

This is my code:


Copy copy = new CopyService.Copy();


Could not load file or assembly 'Microsoft.SharePoint.Search, Version=, Culture=neutral, Pu


Hello, I installed smartpart and I created a usercontrol, single one, and then I want to test the user control before using it in sharepoint, so I created a webpage and dragged the user control, when I press F5, I got this strange error never seen.



 Could not load file or assembly 'Microsoft.SharePoint.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.



I commented the following web.config lines but that didn work


<!--<SafeControl Assembly="Microsoft.SharePoint.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint.Search.WebControls" TypeName="*" Safe="True" AllowRemoteDesigner="True" />

<SafeControl Assembly="Microsoft.SharePoint.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint.Search.Internal.WebControls" TypeName="*" Safe="True" AllowRemoteDesigner="True" />-->

I am not even

Error while deleting the file from sharepoint



    when i am deleting the file from sharepoint the ID which is generating is not cleared, i.e if i have uploaded 10 records in the sharepoint after that i am deleting the 1 st records and i have to upload the new record to sharepoint,then the ID should be 10 only na but it was showing ID 11 in the sharepoint.how can i make the count to 10 or if the count has any limitations in it.


S.Inayat Basha.

On Change:Prevent Evaluation fails with error Could not load file or assembly 'Microsoft.SqlServer.


Hi All,

I am facing a strange issue with Policy Based Management. Exact problem is as below

SQL Setups


I have Lenovo laptop having 3 SQL instances installed on it.

SQL Server 2005 (x86) Developer Edition 9.00.4053  -- Named Instance : SQL2K5

SQL Server 2008 (x86) Developer Edition 10.0.1600.22 -- Named Instance : SQL2K8

SQL Server 2008 R2 (x86) Developer Edition 10.50.1600.1 -- Named Instance : SQL2K8R2


I configured SQL2K8R2 instance as a Centralized Server and registed SQL2K8 & SQL2K5 under this. I configured a new condition by using facet: MULTIPART NAME. As per this condition Table Should start with TEST_ in database TEST . Evaluation Mode set to              On Change: Prevent. Idea is if some one logs to database TEST and tries to create table with name other then starting with TEST_ then it should fail.

I Imported this policy on registered servers thru Centralized Management Server Action, as expected policy got configured on Registred SQL2K8 instance

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.BadImageFormatException: Could not load file or assembly 'Microsoft.Sharepoint.Search

    I've done a fair amount of digging on this and have found this post that suggests that its caused by the .dll being marked for AMD and not for ia64.  This error occurred after I linked the new cluster to the existing sharepoint farm prior to migration.  Then started moving project files over and rebuilding for the upcoming new server name.  I've tried copying the .dll from the regular 12 hive into the GAC but it won't make a change to the processor architecture.

    Do I need to re-run the configuration wizard or something?  Anyone have an easy fix?  Thanks.
    Jack Burnish

Custom File Stream Result error when the client connection is closed


I recently notice that on our MVC 2.0 web app that does images retrieval,  we have this error when the user close the browser before image file is done transmitting :

TypeName: System.Web.HttpException

TypeAssembly: System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Message: The remote host closed the connection. The error code is 0x80070057.

Source: System.Web

TargetSite: Void RaiseCommunicationError(Int32, Boolean)

StackTrace:    at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)

   at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()

   at System.Web.HttpResponse.Flush(Boolean finalFlush)

   at System.Web.HttpResponse.End()

   at CT.iMagio2.Apps.Web.Search.Controllers.ControllerActionResultInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)

   at System.Web.Mvc.ControllerActionInvoker

****ERROR**** File C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\assemblylistLoc.txt is not installed

I am having trouble with some updates after a repair install of a Windows XP Media Center system. Many of the updates that fail to install are updates to .Net rameworks. I ran rhe net framework verification utility for .Net v 1.0 because it is supposed to be part of the OS. It gave the error in the title. How should I proceed?

Using the Client Object Model to read values from Excel file produces 504 error



I use the Client Object Model to retrieve and read values from an Excel file. This is triggered in an Event Receiver on the Document Library where the Excel file lives. I use a simple CAML Query to retrieve the file. This has worked just fine on a dev/test server. 
Now, I just recently deployed this solution to a production/live server and now this code doesn't work anymore. I get an error saying 'The remote server returned an error: (504) Gateway Timeout'. This happnes when I try clientContext.ExecuteQuery();

The difference between the two servers is that on the test server (where it works) the solution is sitting as the root site, so to speak. No host headers or nothing.
On the live server, there are several web applications (SharePoint) on the same port, but with different host headers.

I have tried to trace a little bit and I found that on the test server, the url that is used to create the ClientContext object is 'http://<servername>/<webname>'. The url is comes from the following code: web.Url. I tried changing the url to the DNS name the test server has and that resulted in the same error as on the live server.

Does anyone have any idea what I need to do?

Thanks a billion!

Groove and Sharepoint Workspace 2010 - error during binary file store initiatlization.


I had groove and now have sharepoint workspace.   I had groove get hung up for a couple of hours and finally shut down my computer.   I got a "error occured during binary file store initialization" message.   I tried deleting and clean up all of the groove files but no luck.   I now have Sharepoint Workspace.  The message I get is "SharePoint Workspace is unable to continue because an error occurred during binary file store initialization."   Any coaching is appreciated. 

Transferring files to the Sharepoint sites - Error file is locked




I'm trying to migrate my files from my file server to Sharepoint. However, it kept saying thta the files are in used and locked. However there's nobody accessing the files.


Is there any way for us to do a force moving of files into Sharepoint?

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.
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