Click here to Skip to main content
15,901,284 members
Home / Discussions / WPF
   

WPF

 
QuestionCan't display "Wingding 3" font [modified] Pin
fjparisIII18-May-10 9:27
fjparisIII18-May-10 9:27 
QuestionProblem with Silverlight grid, extra cell Pin
Philky00117-May-10 10:53
Philky00117-May-10 10:53 
AnswerRe: Problem with Silverlight grid, extra cell [modified] Pin
Abhinav S17-May-10 16:21
Abhinav S17-May-10 16:21 
GeneralRe: Problem with Silverlight grid, extra cell [modified] Pin
Philky00117-May-10 16:49
Philky00117-May-10 16:49 
GeneralRe: Problem with Silverlight grid, extra cell Pin
Abhinav S17-May-10 17:33
Abhinav S17-May-10 17:33 
GeneralRe: Problem with Silverlight grid, extra cell Pin
Philky00118-May-10 9:00
Philky00118-May-10 9:00 
AnswerRe: Problem with Silverlight grid, extra cell Pin
Abhinav S18-May-10 17:28
Abhinav S18-May-10 17:28 
QuestionHow does Silverlight find its Web service when the latter is in an assembly? [SOLVED] Pin
fjparisIII17-May-10 8:18
fjparisIII17-May-10 8:18 
I've been trying to figure out how Silverlight communicates with a WCF Web service when the VS2010 Silverlight solution is set up as an ASP.NET Web Application Project rather than an ASP.NET Web Site. As you know, when you set up a Web Application Project, the Web service is generated as a .dll assembly rather than a set of loose .cs files that are supposed to be compiled once, when the Website is first accessed.

But when the solution is set up as a Web Application Project, the service is encapsulated in a dll assembly. In my case, the service is in a DLL called PPTWebsite.Web.dll. When I build the solution, the Silverlight application is also wrapped in a xap file called PPTWebsite.xap and from what I've read, the xap file and the WCF Web service assembly have to be in the same folder on the Website, and further, the xap file has to be in the ClientBin folder off the root of the Website, so that's also where the PPTWebsite.Web.dll file must be located. (I've tried putting the xap file in the root of the Website and that doesn't work at all.)

When I build my solution, a .svc file also gets created that identifies the location of the C# source file containing my Web service. This .svc file must be in the root of the Website and contains the following line:
<%@ ServiceHost Language="C#" Debug="true" Service="PPTWebsite.Web.PHDWebsiteService" CodeBehind="~/ClientBin/PHDWebsiteService.svc.cs" >

What confuses me is that the value of CodeBehind points to the C# source file containing the source of my service implementation but doesn't identify the assembly containing its CIL code. So: how does the Silverlight application know where the code for the Web service is stored when it makes calls to it?

I should also make clear that I have no problem communicating with the Web service when I execute everything from within VS2010. Everything is working perfectly when executed within the IDE.

The reason this is an issue is because when I deploy everything to the actual Website, the Silverlight application is not communicating with the Web service. I know this is true because I stripped down one of the services to a one line function that simply returns true and when the Silverlight event handler gets control it immediately throws an exception with the text, "The remote server returned an error: NotFound." (Google for that text and you will get thousands of hits on forums like this one, and the scary part is that most of the reported problems never seem to get resolved.)

Actually I don't think my problem is related to whether the solution is a Web Application Project or a Web Site, because originally I had a Web Site solution and got the same error. But for now, I'd just like to understand how Silverlight is supposed to talk to the Web server, given the contents of an svc file that only identifies a C# source file containing the service when what gets deployed is a DLL.

Solution: I just tried removing the CodeBehind attribute and the Silverlight application still correctly accessed the service. The CodeBehind attribute plays no part in finding the service, at least in a Silverlight Web Application Project. What is critical is the location of the service assembly relative to the .svc file: apparently it must be in a bin folder off the folder containing the .svc file.

modified on Wednesday, May 19, 2010 1:44 PM

AnswerRe: How does Silverlight find its Web service when the latter is in an assembly? Pin
Abhinav S17-May-10 18:12
Abhinav S17-May-10 18:12 
GeneralRe: How does Silverlight find its Web service when the latter is in an assembly? Pin
fjparisIII18-May-10 6:42
fjparisIII18-May-10 6:42 
AnswerRe: How does Silverlight find its Web service when the latter is in an assembly? Pin
shiznit77019-May-10 7:17
shiznit77019-May-10 7:17 
GeneralRe: How does Silverlight find its Web service when the latter is in an assembly? Pin
fjparisIII19-May-10 7:44
fjparisIII19-May-10 7:44 
QuestionHow to get access to main window controls in WPF Pin
Majid Shahabfar17-May-10 5:11
Majid Shahabfar17-May-10 5:11 
AnswerRe: How to get access to main window controls in WPF Pin
Abhinav S17-May-10 17:42
Abhinav S17-May-10 17:42 
GeneralRe: How to get access to main window controls in WPF Pin
Majid Shahabfar18-May-10 9:14
Majid Shahabfar18-May-10 9:14 
QuestionSL3 Resource Dictionaries [SOLVED] Pin
#realJSOP17-May-10 3:50
professional#realJSOP17-May-10 3:50 
AnswerRe: SL3 Resource Dictionaries Pin
Abhinav S17-May-10 7:04
Abhinav S17-May-10 7:04 
GeneralRe: SL3 Resource Dictionaries Pin
#realJSOP17-May-10 7:07
professional#realJSOP17-May-10 7:07 
GeneralRe: SL3 Resource Dictionaries Pin
Abhinav S17-May-10 7:56
Abhinav S17-May-10 7:56 
GeneralRe: SL3 Resource Dictionaries Pin
#realJSOP17-May-10 8:13
professional#realJSOP17-May-10 8:13 
GeneralRe: SL3 Resource Dictionaries Pin
#realJSOP17-May-10 8:55
professional#realJSOP17-May-10 8:55 
GeneralRe: SL3 Resource Dictionaries Pin
Abhinav S17-May-10 16:16
Abhinav S17-May-10 16:16 
GeneralRe: SL3 Resource Dictionaries Pin
blackjack215018-May-10 1:35
blackjack215018-May-10 1:35 
GeneralRe: SL3 Resource Dictionaries Pin
#realJSOP19-May-10 0:09
professional#realJSOP19-May-10 0:09 
QuestionShapes in Rich text box Pin
r i s h a b h s17-May-10 1:46
r i s h a b h s17-May-10 1:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.