0

I have developed silverlight web part for sharepoint 2010. I have developed nearly 5 web part in sharepoint 2010. All the web parts was working fine upto last night on development machine as well as on server. Now today I started my computer. I have tried to run my web part in vs 2010. I was not working. It is giving error as e.Message - The remote server returned an error: NotFound. and e.StackTrace - at

System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
   at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryGetResponseAsyncCallback(IAsyncResult asyncResult)

The following is my code

public void GetAllCompanies(ListItemCollectionDelegate populateMethod)
        {
            CompaniesListItemCollectionDelegate = populateMethod;           

            ClientContext clientContext = ClientContext.Current;
            List list = clientContext.Web.Lists.GetByTitle("Companies");

            companiesListItemCollection = list.GetItems(CamlQuery.CreateAllItemsQuery());
            //clientContext.Load(list);
            clientContext.Load(companiesListItemCollection);
            clientContext.ExecuteQueryAsync(handleAllCompaniesRequestSucceeded, handleAllCompaniesRequestFailed);
        }

        private void handleAllCompaniesRequestSucceeded(object sender, ClientRequestSucceededEventArgs e)
        {
            ////call back on the UI thread
            System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                CompaniesListItemCollectionDelegate(companiesListItemCollection);
            });
        }

        private void handleAllCompaniesRequestFailed(object sender, ClientRequestFailedEventArgs e)
        {
            System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                MessageBox.Show("GetAllCompanies Method Error : " + e.Exception);
            });
        }

In the above code breakpoints in method handleAllCompaniesRequestFailed gets hit. It executes all statement within GetAllCompanies. I checked that the the development machine is able to access the local sharepoint site in browser. Can you please tell me why this web part is not working today ? Can you please provide me any code or link through which I can resolve the above issue ?

Shailesh Jaiswal
  • 3,606
  • 13
  • 73
  • 124
  • It it was working in the past the first thing you should be doing is finding out what changed. This could be something on your machine, something on the server or something in the code. Once you have found the cause, the solution should be a lot clearer. – ChrisF Jun 27 '12 at 10:48
  • The one thing that was new today - The machine has performed disk checking. Can there is probability that disk checking has deleted or repaired some file ? and that can be the reason for above issue ? – Shailesh Jaiswal Jun 27 '12 at 11:58
  • I wouldn't have thought so, but it is a possibility – ChrisF Jun 27 '12 at 12:04

0 Answers0