Print Page | Close Window

Deployment issues: No endpoint listening

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3567
Printed Date: 13-May-2026 at 12:12am


Topic: Deployment issues: No endpoint listening
Posted By: JohnBloom
Subject: Deployment issues: No endpoint listening
Date Posted: 03-Aug-2012 at 7:14am
We recently switched from an xcopy style of deployment for or Silverlight application to webdeploy. This is part of our move towards Continuous Delivery. Something is wrong however and I cant seem to figure it out.

After we deploy when we send the first request to the server we get the error: "There is no endpoint listening on http://OurServer/EntityService.svc/sI that could accept calls from this application." 

I followed the steps in the error message and I found that http://OurServer/EntityService.svc is running for a little while and then it crashes. When I first deploy the app and navigate to the service it works right away but if I navigate to it later it says the resource cannot be found. Every time I navigate to http://OurServer/EntityService.svc/sI I get the error "resource cannot be found."

In the log files I dont see any error but I do see: EntityService listening on http://OurServer.OurDomain.local/entityservice.svc when I try to navigate to that url I get the resource cannot be found error. However when I look at call to the server in fiddler it looks like this: <a:To s:mustUnderstand="1">http://OurServer/EntityService.svc/sl</a:To>

I turned off IIS compression and I have tried to remove anything from the webconfig that was not essential to running the app and still I am getting the errors. I also confirmed that all of the ideablade dlls are in the bin folder. 

I am running low on ideas so maybe point me in a direction to go.



-------------
-John Bloom



Replies:
Posted By: JohnBloom
Date Posted: 03-Aug-2012 at 8:49am
Wow ok solved this one. But I still might need an answer. My global.asx was set to 

<%@ Application Codebehind="Global.asax.cs" Inherits="MyApp.Global" Language="C#" %>

and I changed it to:

<script language="C#" runat="server">

    /// <summary>
    /// Perform application start activities.  
    /// </summary>
    protected void Application_Start(Object sender, EventArgs e) {

      // To enable remote viewing of trace messages via the TraceViewer:
      // TODO:  Uncomment following line if you want to provide this feature.  
      //IdeaBlade.Core.TracePublisher.LocalInstance.MakeRemotable();        

      // If you don't want to create a .svc file for every EntityServer service, you
      // can instead register a "virtual path provider".       
      // You do not need to supply .svc files for the EntityService and EntityServer services
      // when the provider is registered.      
      System.Web.Hosting.HostingEnvironment.RegisterVirtualPathProvider(new IdeaBlade.EntityModel.Web.ServiceVirtualPathProvider());     
  
    }
</script>

Why didnt the global.asx code behind compile and run when the service was started?


-------------
-John Bloom


Posted By: JohnBloom
Date Posted: 03-Aug-2012 at 8:52am
Also if I want to run MVC along side my silverlight how do I register routes without the asax being compiled?

Example:
routes.MapRoute(
                "Default"// Route name
                "{controller}/{action}/{id}"// URL with parameters
                new { controller = "Account", action = "LogOn", id = UrlParameter.Optional } // Parameter defaults
            );


-------------
-John Bloom


Posted By: sbelini
Date Posted: 03-Aug-2012 at 12:53pm
Hi John,
Regarding you question about Global.asax and code behind, these links might be of some help:
http://forums.asp.net/t/1753543.aspx/1 - http://forums.asp.net/t/1753543.aspx/1
http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/485f7ff7-4428-43db-b715-2b8ef4cddb60 - http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/485f7ff7-4428-43db-b715-2b8ef4cddb60
 
As for alternative ways to resulter routes, try:
http://stackoverflow.com/questions/3342158/alternative-places-to-register-routes-to-global-asax - http://stackoverflow.com/questions/3342158/alternative-places-to-register-routes-to-global-asax - http://stackoverflow.com/questions/3342158/alternative-places-to-register-routes-to-global-asax
 
Regards,
   Silvio.

 



Posted By: JohnBloom
Date Posted: 07-Aug-2012 at 2:23pm
Ok so adding this code to the asax page caused the devforce service to crash in production: 

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

This is boilerplate code for MVC3 and so i didnt think about it when I added it.



-------------
-John Bloom


Posted By: sbelini
Date Posted: 08-Aug-2012 at 1:02pm
John,
 
Is it compiling and crashing, or not even compiling?
 
Any error message?
 
Silvio.


Posted By: JohnBloom
Date Posted: 08-Aug-2012 at 1:21pm
So here is what happened. 

1) I added MVC to our project and put this code in my Global.asax:

protected void Application_Start(Object sender, EventArgs e) 
  {
    System.Web.Hosting.HostingEnvironment.RegisterVirtualPathProvider(new IdeaBlade.EntityModel.Web.ServiceVirtualPathProvider());
 
    AreaRegistration.RegisterAllAreas();
 
    RegisterGlobalFilters(GlobalFilters.Filters);
    RegisterRoutes(RouteTable.Routes);
  }
 
  public static void RegisterGlobalFilters(GlobalFilterCollection filters)
  {
      filters.Add(new HandleErrorAttribute());
  }
  
  public static void RegisterRoutes(RouteCollection routes)
  {
      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

      routes.MapRoute(           "Default"// Route name           "{controller}/{action}/{id}"// URL with parameters           new { controller = "Account", action = "LogOn", id = UrlParameter.Optional } // Parameter defaults       );   }
2) When I deployed I got this error:

   "There is no endpoint listening on http://OurServer/EntityService.svc/sI that could accept calls from this application." 

3) After posting to this forum and trying random things, I discovered that the asax was set to compile:

   <%@ Application Codebehind="Global.asax.cs" Inherits="OurApp.Global" Language="C#" %>

4) When I looked at Devforce samples they were using this code:

   <script language="C#" runat="server">
   ...
   IdeaBlade.EntityModel.Web.ServiceVirtualPathProvider());     
   ...  
   </script>

5) Changing my asax to be script based and removing the MVC specific code made it so when I deployed my EntityServer worked again. Except now my MVC didnt work because I removed the registering of routes.

6) I added the MVC back to the Global.asax page and I started getting the same error.
   
   "There is no endpoint listening on http://OurServer/EntityService.svc/sI that could accept calls from this application." 

7) I removed the lines one by one to see what was breaking and I settled on one line that was causing the no endpoint error. That line was:

   routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
8) I am just getting to know MVC but when I comment out that line both my MVC and my entity server work.
I am not sure what the line does but I have isolated it as the problem.



-------------
-John Bloom


Posted By: sbelini
Date Posted: 13-Aug-2012 at 3:14pm
Hi John,
 
I was able to deploy a simple MVC/SL app here.
The problem I came across was the following:
 
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information
 
which was solved by setting Copy Local to True for all IdeaBlade assemblies.
I also same across some reflection problems where the assemblies' versions on my deployment server were not the same as in my development station. For that I had to be sure all assembly versions matched. (the error messages shown in the browser were very helpful there)
 
As for configuration, I took the steps you described. The only difference would be that in global.asax I used:
 
<%@ Application Codebehind="Global.asax.cs" Inherits="IdeaBladeMVC.MvcApplication" Language="C#" runat="server" %>
 
I think you used <script language="C#" runat="server"> instead.
 
I am attaching the solution so you could check any other discrepancy with your configurations. uploads/892/IdeaBladeMVC.zip - uploads/892/IdeaBladeMVC.zip
 
You can also check the deployment at:
MVC: http://67.169.115.95:8855/SL_MVC/Customers - http://67.169.115.95:8855/SL_MVC/Customers
SL:    http://67.169.115.95:8855/SL_MVC/default.aspx - http://67.169.115.95:8855/SL_MVC/default.aspx
 
Regards,
   Silvio.
 


Posted By: JohnBloom
Date Posted: 17-Aug-2012 at 10:55am
Your app gives me this error during runtime on my dev machine:

Unable to locate type: IdeaBlade.EntityModel.EntityServerException, IdeaBlade.EntityModel, Version=6.1.8.1, Culture=neutral, PublicKeyToken=287b5094865421c0. Check that the assembly holding this type is available in the XAP. Also check that both your assemblies and DevForce assemblies have the expected version number on both client and server.

Also when I deploy your app to IIS I am getting the same error as my project: "No endpoint listening."  

What version of IIS are you using? 
Is it 64bit? 

Sometimes when funky errors are happening it is a bit issue. 

Perhaps it is a problem in my IIS settings?

I tried stripping down my web.config file but nothing helped. 

John


-------------
-John Bloom


Posted By: sbelini
Date Posted: 17-Aug-2012 at 12:46pm
Hi John,
 
I am using DevForce 6.1.8.1.
We will update our portal shortly with this latest version.
 
I am using IIS 7.5 running on Win7 64bit.
 
As for IIs settings, I don't see anything outstanding. Just be sure the appPool being used targets .NET 4.
 
Silvio.


Posted By: JohnBloom
Date Posted: 17-Aug-2012 at 1:47pm
Thanks, 
I feel like I am beating my head against a wall. I did get it to work on IIS that was installed on windows 7 but it doesnt work on two separate Windows Server 2008 R2 machines running IIS. Both on my windows 7 machine and on the Windows Server machines the IIS version is 7.5.7600.16385. It does appear to be an IIS problem. See if you guys can get the sample app to work on a Windows Server machine.

John


-------------
-John Bloom


Posted By: JohnBloom
Date Posted: 17-Aug-2012 at 1:55pm
I have MVC 3 installed on both servers. Am I missing something else that needs to be installed?

-------------
-John Bloom


Posted By: JohnBloom
Date Posted: 17-Aug-2012 at 2:38pm
Ok I got it. On Windows Server 2008 you have to add the Web Server (IIS) Support role. IIS was working and running my Silverlight app without it but when I tried to combine it with the MVC it stopped working. 

I also enabled Named Pipe Activation role. Not sure if that helped but if I get this problem again I am coming back to this thread and I want to make sure I didnt leave anything out.

Note to all. IIS on Windows Server 2008 R2 and the one on your Window 7 box are not necessarily the same. It is nice to end the week having solved this. 


-------------
-John Bloom


Posted By: JohnBloom
Date Posted: 21-Aug-2012 at 1:36pm
I thought that I had it solved but I am still one step away. 

I had turned on allowAnonymousLogin and so the user that was logging in was guest. Once I turned off allowAnonymousLogin the silverlight would not pick up the user that was logged in through an HTML login page. I was passing null credentials and getting a null user back. So I set  aspNetCompatibilityEnabled to true and it worked fine in DEV but I started getting the endpoint not listening error in deployment. 

So I am at a wall. If I turn aspNetCompatibilityEnabled to true I cant login. 

If I set aspNetCompatibilityEnabled to false I cant pick up the user that is logged in by passing null credentials from silverlight.

I am sending you the sample program back with a login screen written in HTML and some other tweaks. Deploy the app and change aspNetCompatibilityEnabled to see the problem. 

I might be chasing the wrong thing so if you can get it to login and work, thats all I want.


-------------
-John Bloom


Posted By: sbelini
Date Posted: 23-Aug-2012 at 12:12pm
John,
 
I've checked with our IT person and he mentioned that, since it apparently worked previously while deploying using xcopy (vs. webdeploy), you should do a compare of the files from both deployments and especially check the contents of web.config, global.asax, and any other config files since you can have web deploy use different config files for development (debug) than for publishing (release).
 
He also noted that if the domain URL doesn’t resolve to a valid IP address for the client, then the client will not reach the endpoint. (i.e your URL is ending in .local)
 
I'll check the updated sample you sent me and will see if I encounter any other problem.
 
Silvio.


Posted By: sbelini
Date Posted: 23-Aug-2012 at 3:16pm
Hi John,
 
I was able to deploy the updated solution without any problems. All I had to do was to update the .xap path and connectionStrings.
 
http://67.169.115.95:8855/SL_MVC2/Silverlight/index - http://67.169.115.95:8855/SL_MVC2/Silverlight/index
http://67.169.115.95:8855/SL_MVC2/Customers/index - http://67.169.115.95:8855/SL_MVC2/Customers/index
 
user: manager
pass: manager! 
 
Note that I'm deploying using xcopy. As suggested in the previous post, try comparing the files from both deployments if the issue is only on webdeploy.
 
Regards,
   Silvio.
 
 


Posted By: JohnBloom
Date Posted: 04-Sep-2012 at 11:11am
Ok I did an xcopy deployment and it started working. So I removed all of the extra files from the xcopy deployment one at a time trying to find the file that was messing me up. I got the file structure exactly the same and it was still working.

Next I compared each file and they were all the same. Except the dll for the web project itself. That file was 2 kb smaller in the project that wasnt working. So I looked to see what my compile configuration was and it was set to release. I changed it to debug and it started working. 

I then switched from the sample application to our application and did the same thing. It also worked. I am now able to move forward but the issue is not completely resolved.

I think I have got it about as narrow of a scope as I can. Using xcopy or web deploy if the project is built in release mode it fails but if it is built in debug it works. 

Can you reproduce that?


-------------
-John Bloom


Posted By: JohnBloom
Date Posted: 05-Sep-2012 at 9:34am
I confirmed this again. My app was not working when built by the build server. When I investigated it I found that although my build script had set the compile to "Debug" my cc.net script was setting it to "Release." I removed the overriding behavior in the build script and the app started working. 

This sounds crazy. Is there are reason for this?


-------------
-John Bloom


Posted By: JohnBloom
Date Posted: 05-Sep-2012 at 9:55am
Ok I have narrowed it as far as I can. 

I understand that debug and release are configurations and that there is no magic going on there so I started playing with the settings. I was able to reproduce the problem with one setting. If under debug you check the checkbox labeled "Optimize Code" the entity service will stop working when you deploy your code. If you release in "Release" mode and uncheck the checkbox the service will work when you deploy.

That is as far as I can go. I am not sure what you guys are doing under the hood but when the code is optimized it is messing things up. As far as I know this is only when you have MVC and Silverlight running together but it could be a problem in other situations. 


-------------
-John Bloom


Posted By: sbelini
Date Posted: 05-Sep-2012 at 10:04am
Thanks John,
 
We are looking into it and will keep you posted.
 
Silvio.


Posted By: sbelini
Date Posted: 10-Sep-2012 at 9:47am
Hi John,
 
We isolated the issue to RegisterVirtualPathProvider not working properly.
We are still investigating the possible causes for this problem and any already known issues with RegisterVirtualPathProvider.
In the meantime, you will be able to deploy you app built in Release mode if you manually add the EntityServer/EntityService.svc files to the application folder.
 
Regards,
   Silvio.


Posted By: sbelini
Date Posted: 01-Oct-2012 at 10:43am
John,
 
It looks like, when using routing, you must ignore the svc files:
 
routes.IgnoreRoute("{*allsvc}", new { allsvc = @".*\.svc(/.*)?" });
 
Adding that to RegisterRoutes solved the issue for me.
 
Can you confirm that it works for you?
 
Silvio.


Posted By: JohnBloom
Date Posted: 01-Oct-2012 at 11:18am
It appears that this has done the trick. Thanks for the fix.

-------------
-John Bloom



Print Page | Close Window