So I am on this epic quest to port an existing CSLA app of mine from using a Windows Forms front end over to Silverlight. I have setup the solution structure in the same way that the Rolodex sample app is build. Everything compiles and appears to be running fine (no runtime errors) but when validating the credentials on the login screen, it appears that DataPortal_Fetch in xxxIdentity never gets executed.
By never executed I mean that within DataPortal_Fetch I am throwing and exception and even trying to output some text to the console but none of the 2 happen, I just get a message back on my UI that logon was invalid. I tried to set a breakpoint in the Rolodex example to see how you get into the DataPortal_Fetch method but it appears that because of the directives that point would never be hit (is there any way of switching this while debugging?)
The ServiceReferences.ClientConfig (in the Silverlight project) and Web.config (in WcfHostWeb) seem set up correctly as is the port used for WcfHostWeb.
Any ideas?
The first step would be to figure out if WCF call gets to the portal.
The easiest way probably is to use the following debugging configuration.
Run yor app, then look at c:\traces.svclog. If it is empty, your call
never gets to the server. At that point you probably want to step through
client call code to see where it fails. Setting break on all exceptions
would also help.
Add
the following to web.config file to web site that hosts WCF service.
<system.diagnostics>
<sources>
<source
name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: triplea
[mailto:cslanet@lhotka.net]
Sent: Monday, November 03, 2008 8:09 AM
To: Sergey Barskiy
Subject: [CSLA .NET] Constructing a Silverlight app based on Rolodex
So I am on this epic quest to port an existing CSLA app of mine from using a
Windows Forms front end over to Silverlight. I have setup the solution
structure in the same way that the Rolodex sample app is build. Everything
compiles and appears to be running fine (no runtime errors) but when
validating the credentials on the login screen, it appears that
DataPortal_Fetch in xxxIdentity never gets executed.
By never executed I mean that within DataPortal_Fetch I am throwing and
exception and even trying to output some text to the console but none of the 2
happen, I just get a message back on my UI that logon was invalid. I tried to
set a breakpoint in the Rolodex example to see how you get into the
DataPortal_Fetch method but it appears that because of the directives that
point would never be hit (is there any way of switching this while debugging?)
The ServiceReferences.ClientConfig (in the Silverlight project) and Web.config
(in WcfHostWeb) seem set up correctly as is the port used for WcfHostWeb.
Any ideas?
Thanks
The trace file gets created and actually has got content so it appears that it does go to the server... Looking at the content of the file I cannot really make out if any errors occured but that does not appear to be the case (the file is attached if you want to take a look).
Stepping through the code is being a bit of a challenge too. As I am stepping through it I never encounter an error (even though in my CustomerIdentity.DataPortal_Fetch() I only have 1 line of code that throws an exception) and anyway it seems that hitting a breakpoint when outside of silverlight (in this case the CustomerIdentity.DataPortal_Fetch() method) is not possible unless you change some settings (not sure how to do that...)
This was stopping me from progressing so I took the Rolodex app itself and started modifying it bit by bit to see where the error would reappear (if it did).
After a lot of tampering it finally worked (the DataPortal_Fetch() was called wherein I was hard-coding the authentication). But then I implemented the check (query to database) and I started getting the same problem, which is I just got a message that logon was unsuccesful...
The problem here is that I cannot step into the code of my DataPortal_Fetch() method as the breakpoint is never hit. I am new to Silverlight so am not sure if:
Could someone kindly answer?
Yes, you can debug server side code. It is easier if WCF
is hosted in the same web site as SL application. If not, you can start another
instance of VS and attach debugger to Cassini base on port number that WCF host
web site is running on. At that point you should be able to hit your server
side breakpoints.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: triplea
[mailto:cslanet@lhotka.net]
Sent: Tuesday, November 04, 2008 11:41 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: Constructing a Silverlight app based on
Rolodex
This was stopping me from progressing so I took the Rolodex app itself and
started modifying it bit by bit to see where the error would reappear (if it
did).
After a lot of tampering it finally worked (the DataPortal_Fetch() was
called wherein I was hard-coding the authentication). But then I implemented
the check (query to database) and I started getting the same problem, which is
I just got a message that logon was unsuccesful...
The problem here is that I cannot step into the code of my
DataPortal_Fetch() method as the breakpoint is never hit. I am new to
Silverlight so am not sure if:
Could someone kindly answer?
Copyright (c) Marimer LLC