Trying to make Silverlight examples work....

55 views
Skip to first unread message

george.n...@hotmail.com

unread,
Mar 19, 2013, 9:15:11 AM3/19/13
to web...@googlegroups.com
Hi,

I am trying to run the silverlight 5 sample, FM.WebSync.Example.Web, which manages to load OK, but fails to connect to anything meaningful.

As a back end server I am trying to use FM.WebSync.Server.Example.2012, which on startup only produces a runtime error page on the browser.

Anyone having suggestions on how to make these two work together?

Thanks,


Ben Swayne

unread,
Mar 19, 2013, 3:33:31 PM3/19/13
to web...@googlegroups.com
Hi George,

It appears you have 2 issues here. Issue #1 is to get the WebSync Server project running. Issue #2 is to get the Silverlight example running.

Because you didn't include any specific details about the runtime error you are seeing, I can't help there. But one really easy quick check is to "run" (or "start debugging") the FM.WebSync.Server.Example.{version} project, then navigate to the websync handler which is by default located at "http://localhost/websync4/websync.ashx". If WebSync is working you will get an intelligible response, if you get an exception you'll need to do a little debugging.

Assuming the websync handler is working and returns "OK" or "WebSync is active", you know the server part is working. Open another instance of visual studio and open the silverlight project you want to test. Now "run" or "start debugging" your silverlight application. Make sure your browser has the appropriate plugin, etc.. (should complain if it doesn't and prompt to install silverlight). You should be able to right click on the page and see the "Silverlight" context menu.

Now if the page is blank, one possible problem is that it isn't loading the silverlight XAP file. Because the `FM.WebSync.Server.Example.Web` project is really just wrapping the silverlight example `FM.WebSync.Server.Example`, its possible the silverlight is not compiling to produce the XAP file silverlight needs. No problem easy to test, just navigate in your browser to the expected file location "http://localhost:27240/ClientBin/FM.WebSync.Example.xap". If you get a file download starting, the XAP file is available. If you get a 404 file not found, something is wrong.

In my case while verifying your issue, I noticed that my browser (chrome) marked the WebSync files as "downloaded from the internet" which visual studio by default will not trust. This is a security thing to make sure you don't compile/execute code from the internet unintentionally. But if that's the case you should get a nice compile time error when you try to build the silverlight project like the following:

"Could not load the assembly file:///...\Downloads\WebSyncServer\Build\MicrosoftLibraries\WebSync\Enterprise\Examples\Silverlight5\FM.WebSync.Example\lib\FM.dll. This assembly may have been downloaded from the Web.  If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information.    FM.WebSync.Example"

In that case, follow the steps provided by Microsoft to "unblock" the FM libraries referenced by the silverlight project (its on the file properties dialog in explorer). Visual Studio will now trust them and build the project successfully.

FYI, in case you want to try pointing the silverlight project to another host, the Silverlight example project `MainPage.xaml.cs` contains the reference to "http://localhost/websync4/websync.ashx". But maybe don't play with that until you've got the "out of box" demo working first just to make sure we don't compound any issues. ;-)

Hopefully that resolves your issues! If not feel free to post some more details about the exceptions or runtime errors you encounter.

Best Regards,

Ben Swayne
Frozen Mountain Software
888-379-6686 (Extension 
103)
www.frozenmountain.com





--
You received this message because you are subscribed to the Google Groups "WebSync" group.
To unsubscribe from this group and stop receiving emails from it, send an email to websync+u...@googlegroups.com.
To post to this group, send email to web...@googlegroups.com.
Visit this group at http://groups.google.com/group/websync?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/websync/-/SYiK2xYtdlAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

george.n...@hotmail.com

unread,
Mar 21, 2013, 11:50:11 AM3/21/13
to web...@googlegroups.com
Hi, thanks for the feedback,

The service works alright, it returns OK no clients yet connected.

The silverlight application compiles OK and is loading OK in chrome browser, asks for a nickname to connect. When I press OK to connect the application comes back with a message:

"Could not connect to WebSync
Security Error (possible cross-domain restrictions). Security Error"

Jerod Venema

unread,
Mar 21, 2013, 11:54:08 AM3/21/13
to web...@googlegroups.com
That's almost certainly just a missing crossdomain.xml file. There's one included in WebSync, but here's the MSDN article on enabling cross-domain communication in Silverlight:


In that article, they reference <allow-from http-request-headers="SOAPAction">, you'll want that to be "*" instead of "SOAPAction"

Best,

--
You received this message because you are subscribed to the Google Groups "WebSync" group.
To unsubscribe from this group and stop receiving emails from it, send an email to websync+u...@googlegroups.com.
To post to this group, send email to web...@googlegroups.com.
Visit this group at http://groups.google.com/group/websync?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/websync/-/J7tCVO9hew4J.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jerod Venema
Frozen Mountain Software
919-300-5141 (United States)
604-227-2453 (Canada)
888-379-6686 (Extension 101)

george.n...@hotmail.com

unread,
Mar 22, 2013, 9:42:33 AM3/22/13
to web...@googlegroups.com
Hi, finally it was a matter of where the  crossdomain.xml  file should have been located, it needs to be present in the root directory of the website, not just inside the service path directory. So now it works fine, not only on the local machine with a local service but also when accessing a service located on an external server.

Thanks again for feed back.

Regards,

George


On Tuesday, March 19, 2013 3:15:11 PM UTC+2, george.n...@hotmail.com wrote:
Reply all
Reply to author
Forward
0 new messages