Remote server returned an error : Not Found

Remote server returned an error : Not Found

Old forum URL: forums.lhotka.net/forums/t/10591.aspx


Jav posted on Thursday, August 04, 2011

Csla 4.2.0 SL
I am trying to install and run my project on the web server but keep getting this error.  Previously I had installed and run the project multiple time a few months ago.  I have now excluded all of my dataaccess code except for a single call. Here is text of the first error message;

---------------------------
FactoryError(Person)
---------------------------
: The remote server returned an error: NotFound.

   at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)

   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)

   at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)

   at Csla.WcfPortal.WcfPortalClient.WcfPortalClientChannel.EndFetch(IAsyncResult result)

   at Csla.WcfPortal.WcfPortalClient.Csla.WcfPortal.IWcfPortal.EndFetch(IAsyncResult result)

   at Csla.WcfPortal.WcfPortalClient.OnEndFetch(IAsyncResult result)

   at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)

: The remote server returned an error: NotFound.

   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)

   at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)

: The remote server returned an error: NotFound.

   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)

   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)

   at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)

How can I debug it.?

Jav

 

RockfordLhotka replied on Thursday, August 04, 2011

Turn on WCF tracing to get the detail about what is happening.

The WCF implementation "protects" all the useful information from going back to the client for security reasons, so the only way to figure out many of these issues is with WCF tracing, or sometimes with fiddler.

If you have the Using CSLA 4: Data Portal Configuration ebook, I show the configuration to enable tracing in the book. And of course there's information on the web about how to configure the server for tracing as well.

Jav replied on Friday, August 05, 2011

Thanks Rocky,

I do have the CSLA 4: Data Portal book, I'll make use f it.

Javed

Jav replied on Friday, August 05, 2011

I right clicked the .svc file and selected DisplayInBrowser, a true enough, there was a problem with the value I had in the ...timing numbers.  I fixed that, and if I had any sense - I should have stopped tight there because most likely that would have solved my problem.  But NO!  I saw the invitation to use the svcutil.exe to do more and I accepted.

Well, I think now I have got myself into another pickle.  When I ran the svcutil.exe, it told me it created two files in the same bin folder.  One of them was the CopmressedHost, the other I do not remember.  I searched every which way but I have not been able to find the files anywhere.  But that is not my problem.  Problem is that now even in my VS Development Web, the program is acting weird.  All the data that is coming from my ADO code within the Csla objects is returning just fine.  But I am also using an ObjectFactory that talks to a dll which get the data from a Sql server and that is coming back empty handed.  With breakpoints, I know that the code reaches the right methods in the ObjectFactory, but while executing perfectly good code, it simply quits and suddenly I am back in my browser window without any data.

I am thinking: could it have something to do with the two files I created wiht svcutil.  I have never seen anything like that.

Jav

Jav replied on Friday, August 05, 2011

I had to be unavoidably away from my machine for 4 hours.  I came back, wokeh'r up, started up the VS, pushed F5, and everything is working just fine - at least as for as the ObjectFactory Fetch in my Devlopment server is concerned.

Has anybody else tried this method for fixing bugs?

Jav

Jav replied on Saturday, August 06, 2011

The problem appears to be strange and complex.
Briefly, I am using an older copy of my project from 4/6/2011.  (The last time I ran the project remotely was in March 2011, and it ran fine)  The 4/6 project was using CslaSource-4.1.0-110118.  Locally, it ran just fine when I backed it up and also now.  I had never tried to run it remotely previously.  But when I tried a day or so ago, it gave me the following error that I previously reported a few days ago. (http://forums.lhotka.net/forums/t/10588.aspx)
Could not load file or assembly 'Csla, Version=4.0.1.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies

In an effort to find a last project that ran okay remotely, I decided to go back and try to fix the Csla version error in the 4/6 project and try again.  So I removd all the Csla 4.1 reference from every project, and replaced them with CslaSource-4.0.0-100708.  Everything compiled just fine.  But when I ran the project locally, it wouldn't run (with 4.1 it ran locally just fine) What I got was a nonspecific error 4004. 

I next walked though the code all the way to the first line in proxy_CreateCompleted in WcfProxy.cs.  When I looked at the e.Result, what I saw was rather interesting.

e.Result.InnerException read:
-  base {System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)} System.SystemException {System.Net.WebException}

To Recap:

With Csla 4.1, the project runs flawlessly locally but running remotely gives an error: Could not load file or assembly 'Csla, Version=4.0.1.0
With Csla 4.0, the project running locally comes up with the dreaded : The remote server returned an error: NotFound

I have attached the TraceLog files, both from my machine running locally and from the server.  They are in separate folders.  Luckily, they only have the pertinent information and nothing else.  Here is a listing of their contents:

LOCAL EXECUTION FILE

1:17:53 PM
Local Program Execution with breakpoint at the first line in proxy_CreateCompleted in WcfProxy.cs

e.Result.InnerException read:
-  base {System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)} System.SystemException {System.Net.WebException}

1:47:25 PM
Local Program Execution with NO breakpoints

REMOTE EXECUTION FILE 
1:59:02 PM
Remote execution log

I will next run my current program with tracing, both locally and remotely to see if the trace results are similar.  But since local error message of Not Found was the same, I thought I should report this first.

Thanks
Jav

Jav replied on Saturday, August 06, 2011

I have now been working with my most current version, with Csla 4.2.  I have looked at the trace log and the only error I see (repeatedly) is this:

Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=0.84.0.0, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. The system cannot find the file specified.

That is surprising because the references to the CompressedClient and CompressedServer libraries are present in every project, and in all it is marked as CopyLocal = true.  I have even looked in the .xap file and I can see CompressionLib.dll (size 6144) and SharpZipLib (size 141824).  I am not sure if any other library is supposed to be there.

Any suggestion will be appreciated.

Jav

Jav replied on Saturday, August 06, 2011

I downloaded the latest SharpZipLib for Silverlight 4, and the NotFound error has disappeared.  Yeah!

Jav

Jav replied on Sunday, August 07, 2011

The Not Found issue has been resolved but the other nagging issue about not being able to load file or assembly 'Csla, Version=4.0.1.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies, when I am using, now in this case, Csla4.2.

I have two different SL Solutions that share some projects.  Specifically, the smaller Solution uses 10 projects (5 libraries) from the larger Solution that has 18 projects.  The SL and Web projects are separate, of course. Both are Csla4.2, of course.  It was the smaller project that I was troubleshooting all along in this episode. ( to dispel any confusion when I talked about Csla 4.1 and 4.0 projects in earlier posts, I had dug up an old copy of the smaller project to mess with.  These current projects I am taalking about now were moved to newer Csla versions when they became available and have never been reverted or anything like that)

So, the reason for the Not Found issue in the smaller Solution was largely due to the Compression library.  When that was fixed, the problem went away.

This morning, since the Compression projects are used in the larger project also, I decided to test it.  Locally, everything works fine.  Remotely also, as far as Not Found problem is concerned, it is all okay. But I am seeing this mesage about not being able to load file or assembly 'Csla, Version=4.0.1.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies.  I have looked at the trace log, and it looks fine with no red lines at all.

I have never encountered such a problem before.  10 of the projects in the solution are the same as in the smalled project - and there is no such problem there.  The remaining projects, I have looked at over and over again, and I do not see anything but Csla4.2 references..  Unfortunately, the last time I tested this Solution remotely was with Csla 4.0 - a few months ago.  The smaller Solution came into existence since that time and I have spent all of my time getting that one up to speed. So I do not have any experience of running this larger Solution remotely with either 4.1 or 4.2

Jav

 

Jav replied on Monday, August 08, 2011

Can I please get some help on this issue which is in my very last comment.  You can ignore all the previous comments.

RockfordLhotka replied on Monday, August 08, 2011

One reason I've seen this happen is because a Silverlight project references a .NET assembly, or a .NET project references a Silverlight assembly. So you think you have the right version because the version number is correct, but you actually have the wrong assembly.

Another reason this seems to happen has something to do with Visual Studio caching. Try cleaning your project (that's an option in the VS Build menu). Or get one of those external tools that does a "full cleaning" of a solution (though I've never used them - so maybe they are junk?).

I suspect some of your previous issues were due to IIS/ASP.NET caching. When you went away and came back later and it worked - that sounds like IIS/ASP.NET flushing a cache, or spinning down the server instance (which would clear the caches).

Jav replied on Wednesday, August 10, 2011

Thanks for the hints. My assembly references have been correct all along, and I can easily be accused of over cleaning my Solution because I probaby do it half a dozen time every day.  I finally have a handle on what is likely causing the issue, and thought I will share it here. 

BTW, this note is NOT about the Not Found error, but about the Csla 4.0.1 not found error (the Solution is using Csla 4.2)

I ended up slowly and methodically peeling away funtionality one section at time, starting with the SL project first.  While the error always appeared when the SL project was accessed, it turned out that even going down to a barebones MainPage did not eliminate the error.  Next I removed all the libraries one by one - but the error persisted. 

Up until then I was doing the testing on the remote server because locally everything always worked just fine.  Now, having no libraries, and with barebones SL project, I decided just run it locally.  As soon as I pressed F5 I saw the same error message complaining about this line in the Default.aspx (my Start Up Page).

  <%@ Register assembly="Csla" namespace="Csla.Web" tagprefix="cc1" %>


What is interesting is that the error message was exactly what I was seeing all the time, that Csla 4.0.1 cannot be located.  I had searched the entire solution, more than once, searching for Csla 4.0.1 and even for 4.0.1 and always found nothing.  How does this little line remember that it needs Csla 4.0.1, and Csla 4.2 is not acceptable, is beyond my understanding.  But I do have a possible, and of a more practical use, reason.  The line was superfluous and should not have been there.  There was no complaint when I removed it, and others like it, and once I removed a few unnecessary using Csla statements also from the pages in the Web project, the errors disappeared.  I suppose I had these because there was some Csla content on those pages months ago when I got started.

I am now reassembling my Solution bit by bit, and hopefully it will remain error free to the end, but I am not there yet.

Jav

Copyright (c) Marimer LLC