New Posts New Posts RSS Feed: Deployment problem
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Deployment problem

 Post Reply Post Reply
Author
robertk View Drop Down
Newbie
Newbie
Avatar

Joined: 09-Sep-2010
Posts: 1
Post Options Post Options   Quote robertk Quote  Post ReplyReply Direct Link To This Post Topic: Deployment problem
    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) 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.
Back to Top
ceramist View Drop Down
Newbie
Newbie


Joined: 21-Dec-2011
Posts: 9
Post Options Post Options   Quote ceramist Quote  Post ReplyReply Direct Link To This Post 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.

Edited by ceramist - 21-Dec-2011 at 5:03am
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post 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.


Edited by sbelini - 21-Dec-2011 at 10:58am
Back to Top
ceramist View Drop Down
Newbie
Newbie


Joined: 21-Dec-2011
Posts: 9
Post Options Post Options   Quote ceramist Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ceramist View Drop Down
Newbie
Newbie


Joined: 21-Dec-2011
Posts: 9
Post Options Post Options   Quote ceramist Quote  Post ReplyReply Direct Link To This Post 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
 
 
or if you wish, you can allow DevForce to create the bindings itself and modify it in code using the information in this article
 
 
I also found the information in this article very helpful as it walked-through the problem step-by-step, even duplicating the generated errors.
 
 
As a suggestion, I think DevForce's code for self-generating WCF endpoints and bindings needs to auto-insert the correct authentication scheme.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down