Print Page | Close Window

Deployment problem

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=2142
Printed Date: 13-May-2026 at 2:02pm


Topic: Deployment problem
Posted By: robertk
Subject: Deployment problem
Date Posted: 10-Sep-2010 at 5:51am
I am getting the following runtime error when deploying my silverlight application to a server:
 
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E)
Timestamp: Thu, 9 Sep 2010 19:07:19 UTC

Message: Unhandled Error in Silverlight Application Object reference not set to an instance of an object.   at IdeaBlade.EntityModel.EntityManager.<>c__DisplayClassf.<LoginAsync>b__d(BaseOperation baseOp)
   at IdeaBlade.EntityModel.BaseOperation.BaseOnCompleted()
   at IdeaBlade.EntityModel.BaseOperation.IdeaBlade.EntityModel.IHasAsyncEventArgs.OnCompleted()
   at IdeaBlade.EntityModel.AsyncProcessor`1.<>c__DisplayClass2.<.ctor>b__0(TArgs args)
   at IdeaBlade.EntityModel.AsyncProcessor`1.Signal()
   at IdeaBlade.EntityModel.AsyncProcessor`1.<Execute>b__5(Object x)
 
I am using Devforce version 6.0.4
Also, when I try to view the entity service ( http://iis1/silverlightria/entityservice.svc - http://iis1/silverlightria/entityservice.svc ) I get the following error: "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service"
 
I am using the web.config example provided in the examples.



Replies:
Posted By: ceramist
Date Posted: 21-Dec-2011 at 5:03am
Would this problem have an answer, its the same one I am having.  Everything works well in development on my machine, but not when running the application from the webserver.


Posted By: sbelini
Date Posted: 21-Dec-2011 at 10:47am
Hi Ceramist,
 
The simplest way to overcome this error is to enable Anonymous Authentication.
You can do that in IIS by selecting your site >> Authentication.
 
If you must run with Anonymous authentication disabled, you should follow the steps below:
- Disable “Anonymous” authentication and enable your authentication of choice for the application’s virtual directory in IIS
- In the web.config, add <location> elements to enable “Anonymous” authentication for all of your .svc files (you still need anonymous authentication to start the service):
      <location path="EntityService.svc">
            <system.webServer>
                  <security>
                        <authentication>
                              <anonymousAuthentication enabled="true" />
                        </authentication>
                  </security>
            </system.webServer>
      </location>
      <location path="EntityServer.svc">
            <system.webServer>
                  <security>
                        <authentication>
                              <anonymousAuthentication enabled="true" />
                        </authentication>
                  </security>
            </system.webServer>
      </location>
    
     
- Unlock the “authentication” elements in the computer’s “applicationHost.config” file.
-- On 32-bit systems: C:\Windows\System32\inetsrv\config
-- Change overrideModeDefault="Deny" to overrideModeDefault="Allow" for all authentication types
                <sectionGroup name="authentication">
                    <section name="anonymousAuthentication" overrideModeDefault="Allow" />
                    <section name="basicAuthentication" overrideModeDefault="Allow" />
                    <section name="clientCertificateMappingAuthentication" overrideModeDefault="Allow" />
                    <section name="digestAuthentication" overrideModeDefault="Allow" />
                    <section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Allow" />
                    <section name="windowsAuthentication" overrideModeDefault="Allow" />
                </sectionGroup>
 
Test by manually browsing to the service file names.
 
I hope this helps,
   Silvio.


Posted By: ceramist
Date Posted: 21-Dec-2011 at 9:07pm
Thank you for the reply.  However, shouldn't this be a non-issue for DevForce to work seamlessly on IIS?  The deployment documentation points toward a solution that indicates there is nothing to change on IIS for the application and DevForce to work correctly.  Enablling these changes in IIS application configuration would need to occur for each deployment and appears unique to DevForce.  I would have thought that DevForce was handling all the WCF issues and able to deploy under Windows Authentication environments without these changes necessary.
 
Are there other solutions?  Is it really necessary for the auto-generated EntityService and EntityServer to run with anonymous authentication initially?


Posted By: sbelini
Date Posted: 22-Dec-2011 at 12:36pm
Hi Ceramist,
 
This is not a DevForce issue, but a Silverlight characteristic.
So disabling anonymous access requires coordinating the settings in IIS and in your service configuration.
 
Regards,
   Silvio.


Posted By: ceramist
Date Posted: 14-Jan-2012 at 10:20pm

I have found that using Anonymous Authentication is not necessary for DevForce.

 
The key feature is to setting up IIS in a standard way, disabling Anonymous Authentication, enabling Windows Authentication, and then forcing the WCF bindings to accept the desired Authentication Scheme.  If you are setting you own bindings in web.config, one can follow this article
 
http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-custom-client-servicemodel - http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-custom-client-servicemodel
 
or if you wish, you can allow DevForce to create the bindings itself and modify it in code using the information in this article
 
http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-custom-server-configuration - http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-custom-server-configuration
 
I also found the information in this article very helpful as it walked-through the problem step-by-step, even duplicating the generated errors.
 
http://ajdotnet.wordpress.com/2010/08/08/silverlight-and-integrated-authentication/ - http://ajdotnet.wordpress.com/2010/08/08/silverlight-and-integrated-authentication/
 
As a suggestion, I think DevForce's code for self-generating WCF endpoints and bindings needs to auto-insert the correct authentication scheme.



Print Page | Close Window