This is probably very simple but bear with me.
When I deploy my Silverlight 5 application with WCF to IIS, using a simple copy and paste technique I can browse the web site flawlessly, but when I try to access it through ipaddress like this 192.168.1.3:8099 every single service call returns error such as this one:
An exception occurred during the operation, making the result invalid. Check InnerException for exception details.
at .....
at <MyNamespace>.OnGetSomethingFromDataBaseCompleted(Object state)
I can target the WCF services from other machines with success (192.168.1.3:8099/SomeService.svc).
I wrote the test console app to call (and close) the service and it correctly gets some data from the remote DBServer.
Yet in browser nothing.
A should add that back from browser when navigate to 192.168.1.3:8099 Fiddler doesn’t register this call but it does from localhost:8099.
Can you help?
I think that this is simple question for someone more experienced with deployment than me but if you think you should, please read on.
So you are reading on => (Prism).
I have a Silverlight application that connects to database calling WCF services (added as Silverlight WCF service – VSTemplate).
In this application I introduce Prism like Jeremy Likness suggests on his blog
I also use web proxies to access WCF services from ViewModel.
My project structure:
- WEB project
- SilverlightAppWithShell
- ModuleA
- ModuleB
- CommonProject
Deployment directory structure:
C:\inetpub\wwwroot\MyAppFolder (IISUsers have accessToIt)
- .\bin\AllDlls
- .\ClientBin\AllXapFiles(XAP files from all projects mentioned above)
- .\Services\All *.cs files defining services operation contracts
- .\Web.config
- .\TestPage.html
- .\TestPage.aspx
- .\Silverlight.js
- .\AllServices *.scv files
and last but not least
- .\clientaccesspolicy.xml
with this code inside it:
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>"
</allow-from>
<grant-to>
<resource path="/Services" include-subpaths="true"/><!--I tried with App_Code here when renaming Services dir to App_Code with the same wain result-->
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
Thank you for reading
This is what I ended up doing and solved my issue, following this post from Carlos Figueira. I am not sure if there is a better solution with Silverlight 5 but it works for me.