Skip to main content
Home Forums Silverlight Programming Visual Studio & Silverlight Development Tools WCF Issues...
65 replies. Latest Post by umarkashmiri on October 24, 2008.
(1)
muxdaddy
Member
30 points
20 Posts
06-07-2008 7:51 PM |
Ok, this is a bit frustrating. I've uninstalled everything from the beta 1, installed everything from Beta 2. Everything's good. Up until I try to add a WCF SErvice OR a Silverlight-enabled one. Here's the steps...
Create a new silverlight app..
Choose to have it create a website for me.
Add a Silverlight enabled WCF service (it creates Service.svc, then throws a Object reference not set to an instance of an object)
Add service reference to Silverlight app.
Put in web address of this new service, hit Go.
It pops up the DoWork(), so it found it.
Hit Ok, it gives the same error again.
This time, hit Advanced and... Unable to find service "DynamicTypeService". Ensure that the application is installed correctly.
Any ideas?
mikek@
4 points
7 Posts
06-07-2008 8:39 PM |
You're not alone with that error :) I'm experiencing the same problem when trying to add a service reference. "Object reference .." when pressing ok in the add service reference dialog, and also the mentioned error pressing the advanced button.
Furthermore Visual Studio complains when closing saying it encountered an error and then restarts.
So one more person listening for good ideas.
06-07-2008 8:49 PM |
I didnt want to mention that error, as i can put up with it, if someone can just let me know what hte wcf issue is. i've got a launch to hit and now all my services don't work :(
kinda funny, but we were waitin on a go-live license for a while and now that we have it our code won't work. :)
jamlew
Contributor
2786 points
425 Posts
06-07-2008 9:46 PM |
Did you build between creating the service and adding the reference to it?
Muxdaddy
06-07-2008 9:53 PM |
Yes, everything builds properly. It still blows up.
sladapter
All-Star
17181 points
3,133 Posts
06-08-2008 10:35 AM |
Yes, I'm having exact the same issue. Can not add Web Service reference to my silverlight project. The discover button does not bring anything to the list, If I type the service URL and hit go, the service would be shown in the list. But when I click OK to add it, it error out with "Object reference not set to an instance of an object" message.
I'm wondering if it has something to do with the operating system because not every body has this problem. I'm on WindowsXP Service Pack 2. Anybody else want share this information? It must be something in common among us who's having this issue.
06-08-2008 10:55 AM |
Vista Business SP1, so that is not a common ground (VS2008 Team Suite, ADO Entity Framework B3, Silverlight unit test dlls)
06-08-2008 11:01 AM |
Ok, so it's not operating system. What else could it be then?
geekpunk
194 points
40 Posts
06-08-2008 11:08 AM |
same problem here
06-08-2008 11:10 AM |
By the way, I also found everytime when I try to close the VS, VS crashes. Then it trying to send an error report and re-opens. Has anybody seen the same problem? I'm not sure it's related or not.
06-08-2008 12:11 PM |
yes same problems.
1) add reference, you get an object not set to instance of an object
2) update or advanced when adding you get an error stating "unable to find dynamictypeservice, ensure the application is installed correctly"
3) on close it crashes and restarts.
I have tried this w/ new projects and projects im porting to beta 2 all with the same results
06-08-2008 12:26 PM |
I have also tried a repair from the installer and same behavioir
gabouy
219 points
45 Posts
06-08-2008 1:07 PM |
same problems here, W2k3 and VS2008 without SP, I feel like going back to beta 1
If anyone comes with a fix or workaround please let us know
vitya
111 points
75 Posts
06-08-2008 1:34 PM |
sladapter:By the way, I also found everytime when I try to close the VS, VS crashes. Then it trying to send an error report and re-opens. Has anybody seen the same problem? I'm not sure it's related or not.
Exactly the same here...
One more thing: I also noticed te following warning in the Erros/Warnings/Messages window:
In the Errors window I get the following WARNING: The custom tool 'WCF Proxy Generator' failed while processing the file 'Service References\[MyServiceName]\Reference.svcmap'
My environment:
As a test I installed VS on a test box, and there everything works perfectly. The test environment:
Maybe, if more peoplpe (with AND withouth these problems) post their environmet, we can figure it out..
Deepak V...
54 points
13 Posts
06-08-2008 2:21 PM |
Are you using "{Binding Path=variablename}" try "{Binding variablename}"
06-08-2008 3:06 PM |
Exactly where would i use that?
06-08-2008 3:15 PM |
Deepak Verma:Are you using "{Binding Path=variablename}" try "{Binding variablename}"
What do you mean? Where do we set the binding?
Please! This is really a show stopper for us. Anybody from Microsoft knows what is going on?
06-08-2008 3:32 PM |
WCF does not give any errors on my installation, can you upload sample of your code somewhere and I can check for you.
06-08-2008 3:57 PM |
I don't think it's the code problem. SteveWong does not have this problem, and he sent his project to me (just very simple one, create a new Silverlight project with a Web project, add one WCF in the web service without any code change. try to add the Service Reference in the Silverlight project). But I had the same problem on his project. We even compared all the Silverlight and VS 2008 related installations on both machines, same version on everything.
The only difference we saw is the size on Silverlight Tools beta 2 for VS2008. He got 1.18 MB and mine is 1.14 MB. I don't know where the 0.04 MB difference come from since we downloaded from the same link. And I don't even know if that difference means anything.
Anybody wants to check the size of the Silverlight Tools beta 2 for VS2008 (under the Add Remove Programs window) and report back?
06-08-2008 4:49 PM |
Yep, mine is 1.14 as well. I'd agree, it's not a code problem, it's an install problem.
Like when i started the thread above, new project, add wcf service, blows up when you look for it from silverlight.
Psychlis...
6035 points
973 Posts
06-08-2008 4:51 PM |
For grins, I just tried this on my machine and it worked fine; no crashes.
Pete
06-08-2008 4:55 PM |
Psychlist1972:For grins, I just tried this on my machine and it worked fine; no crashes. Vista Ultimate 32 bit .NET 3.5 SP1 Beta Pete
How large is your silverlight tools install (from add/remove programs)?
06-08-2008 5:48 PM |
this is a configuration issue. I have the problem as well and my size is 1.14
phuguet
21 points
06-08-2008 8:25 PM |
I am having the same problem with a web service that worked prefectly with the Beta1 of silverlight 2.
I rebuilt my application Added a service Reference, As I clicked OK it said "Object reference not set to an instance of an object"
and if I click on the advanced properties of the service reference dialog it says : "Unable to find 'DynamicTypeService'. Ensure that the application is installed corectly"
Is the there a workaround using ServiceUtil ?
06-08-2008 8:30 PM |
My version of Silverlight tools uses 1.14MB (Vista Ultimate 32 bit)
And Visual Studio Crashes as well when closing it.
06-08-2008 10:16 PM |
Muxdaddy: Psychlist1972: For grins, I just tried this on my machine and it worked fine; no crashes. Vista Ultimate 32 bit .NET 3.5 SP1 Beta Pete How large is your silverlight tools install (from add/remove programs)?
Psychlist1972: For grins, I just tried this on my machine and it worked fine; no crashes. Vista Ultimate 32 bit .NET 3.5 SP1 Beta Pete
1.17 MB
06-08-2008 10:24 PM |
So, everyone who's install so far is 1.17 works perfect. Everyone who has a 1.14 install doesn't work.
Question is, what causes the difference in sizes?
06-08-2008 11:09 PM |
I have found a resolution. Here is what I had to do
1)I ensured that every silverlight related application was uninstalled, this included a previous december copy of blend as well as deepzom composer.
2) I removed the following dll C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Microsoft.VisualStudio.ServicesProxy.dll
now am up and updating properly. My guess is that most of this points to the dll. Hope this helps others.
SteveWong
6323 points
1,281 Posts
06-08-2008 11:14 PM |
But I have this Microsoft.VisualStudio.ServicesProxy.dll
also can make the WCF Service works for me..
So I think it doesnt matter to have this dll
06-08-2008 11:21 PM |
I think what is happening , is that if the installer see's this file , it leaves it in place, but it is incompatable w/ the rest of the changes.
Again this worked for me
sunraybrett
2 points
1 Posts
06-08-2008 11:36 PM |
I am running Vista Sp1 32bit and have just installed chainer for silverlight Beta 2. I can get the webservice to create the proxy and reference its methods but when I run my previously working projects they produce the error below. These were working fine in Beta 1 but now produce this error. I decided to test a new project. So I created a new silverlight with web application project, added a wcf service and hooked up a button to fire the wcf service. I changed the binding to basic and used the template created. The same error occured. Help, it is no good having a go-live licence when we can not access our data stores.
System.ServiceModel.ProtocolException was unhandled by user code Message="The remote server returned an unexpected response: (404) Not Found." StackTrace: at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result) at SilverlightTest.ServiceReference1.Service1Client.Service1ClientChannel.EndGetData(IAsyncResult result) at SilverlightTest.ServiceReference1.Service1Client.SilverlightTest.ServiceReference1.IService1.EndGetData(IAsyncResult result) at SilverlightTest.ServiceReference1.Service1Client.OnEndGetData(IAsyncResult result) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result) InnerException:
martintr
42 points
29 Posts
06-08-2008 11:43 PM |
hi everyone
I have got the WebService references working just fine but now I am getting a IsReference=True problem when
using Entity Framework entities in the WebService.
Any one found this issue or am I in the wrong spot?
Thanks
Martintr
06-09-2008 12:46 AM |
geekpunk: I have found a resolution. Here is what I had to do 1)I ensured that every silverlight related application was uninstalled, this included a previous december copy of blend as well as deepzom composer. 2) I removed the following dll C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Microsoft.VisualStudio.ServicesProxy.dll now am up and updating properly. My guess is that most of this points to the dll. Hope this helps others.
Excellent!! that worked! Thank YOU!
timanderson
67 points
34 Posts
06-09-2008 5:33 AM |
Mine is fixed too, thanks mostly to this thread.
See here for what worked for me. That was after all the struggles with KB949325. Overall - not too smooth.
Tim
snelldl
148 points
141 Posts
06-09-2008 8:23 AM |
fixed mine too! Thanks!
06-10-2008 8:08 AM |
weird thing. I blew my machine out, reinstalled everything and it worked perfectly.
Thanks for everyone's help in getting my problem solved. :)
KevD
181 points
38 Posts
06-11-2008 3:20 AM |
sunraybrett: I am running Vista Sp1 32bit and have just installed chainer for silverlight Beta 2. I can get the webservice to create the proxy and reference its methods but when I run my previously working projects they produce the error below. These were working fine in Beta 1 but now produce this error. I decided to test a new project. So I created a new silverlight with web application project, added a wcf service and hooked up a button to fire the wcf service. I changed the binding to basic and used the template created. The same error occured. Help, it is no good having a go-live licence when we can not access our data stores. System.ServiceModel.ProtocolException was unhandled by user code Message="The remote server returned an unexpected response: (404) Not Found." StackTrace: at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result) at SilverlightTest.ServiceReference1.Service1Client.Service1ClientChannel.EndGetData(IAsyncResult result) at SilverlightTest.ServiceReference1.Service1Client.SilverlightTest.ServiceReference1.IService1.EndGetData(IAsyncResult result) at SilverlightTest.ServiceReference1.Service1Client.OnEndGetData(IAsyncResult result) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result) InnerException:
I have the exact same problem. Tried this on a beta 1 install: works flawlessly. Tried it on a beta 2 install (on a fresh VPC, so no clutter from previous installations): doesn't work at all.
First I thought I just forgot the crossdomain.xml (services hosted on another address than the client accessing them), but that's not the case. I've looked into the bindings, everything seems ok.
What are we missing here? And mainly: why doesn't this work out of the box - looks quite straightforward to me? At the moment I'm stuck in a situation where I can't access any of my services - so any help would be appreciated :-)
06-11-2008 3:33 AM |
Check the port number. When you debug ASP.NET in Visual Studio, the built-in web server starts up on a port number that is assigned to the project somehow. I noticed that when I added several web services to an ASP.NET project, the port assignment got messed up, so that some web services were on one port, and others on another. Only one instance of the web server starts up, so attempting to access the web services that were assigned the "wrong" port resulted in a 404.
I've not checked further, but presumably there is some way to fix this up, if it is the problem. It wouldn't occur in deployment because you would use a real web server with the port of your choice (default 80).
06-11-2008 3:35 AM |
I ran into this problem a few times today too, as well as another weird error where it couldn't load "asp_web_<random characters'.
what i had to do was to right click on the .svc and view in browser. if it didn't come up correctly, i had to rebuild my solution. click on the .svc, view in browser. if it didn't come up, rebuild. sometimes it would work, sometimes it wouldn't. Seemed pretty random to me, but it worked more than not. sometimes i had to rebuild it 5 or 6 times, but it always eventually started to work again. once i got the .svc to come up in the browser, the silverlight call would work again.
06-11-2008 3:58 AM |
@ Tim: I've looked into that, I use fixed port numbers for the development web servers VS automatically starts, so that shouldn't be the problem - just to make sure, I re-checked the port numbers, but they seem fine.
@ MuxDaddy: the service builds and shows without any problems - I can surf to it, I can ask for the wsdl, ... I just can 't seem to call it from my SL-app...
So I'm afraid this didn't solve the problem.. :s
06-11-2008 5:06 AM |
@KevD
Any clues in ServiceReferences.ClientConfig?
06-11-2008 6:54 AM |
timanderson: @KevD Any clues in ServiceReferences.ClientConfig? Tim
Hello Tim. Nothing out of the ordinary; it looks pretty standard, containing the address (which is correct), the bindingconfig, bindingtype, contract and name. All look correct to me:
<configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_Service1" maxBufferSize="65536" maxReceivedMessageSize="65536"> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:1085/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Service1" contract="SilverlightApplication1.ServiceReference1.Service1" name="BasicHttpBinding_Service1" /> </client> </system.serviceModel></configuration>
I'm out of clues here. I re-created the complete same simple sample project with beta1, and it works in beta1. But with beta2, I keep on getting the "404"-error.
06-11-2008 8:25 AM |
I guess you could use Fiddler to inspect the traffic:
http://www.fiddlertool.com/fiddler/version.asp
Rui-Marinho
146 points
89 Posts
06-11-2008 11:03 AM |
does anyone found the solution for the add service reference error?
i see lots of posts, but no one from microsoft can help us with this??? come on.. it's really frustrating..
please help me
06-11-2008 11:32 AM |
Rui-Marinho,
The post that marked as answer on this thread should be the solution if you are having the same install issue as most us had.
First check your Silverlight Tools for VS 2008 install size on Add/Remove Programs window. If it is 1.14 MB, then you need to do the following:
1) Uninstall your Silverlight Tools for VS 2008,
2) Remove (delete) the following dll C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Microsoft.VisualStudio.ServicesProxy.dll
3) Re-Install Silverlight Tools for VS 2008.
If your tool's install size is already 1.18 MB, then your problem is not install problem. Should be something different.
06-11-2008 11:50 AM |
I've just read that a message size limitation can raise a 404 error:
http://silverlight.net/forums/t/17932.aspx
Relevant?
06-11-2008 12:35 PM |
thanks slap adapter it works fine...
but is very strange to have to do this in a go live license..
06-11-2008 12:37 PM |
So what was your problem?
06-11-2008 1:07 PM |
i had the 1.14, i follow this instructions and moved that dll out of the way and it works..
still i m having a error... does this work in beta 2.0?
i have a service this service working on beta 1.0 like this, but it gives me this erros in beta 2.0
DataServiceProxy.
dataSoapClient.GridAsync(op);
06-11-2008 1:18 PM |
What kind of error do you get? Compiling or Run-time? If it worked in beta 1, could be cross-domain issue again. The clientaccesspolicy.xml need to be updated for beta 2. Check other post about this.
06-11-2008 1:54 PM |
the error is on run-time, i updated the crossdomain.xml with
<
</
06-11-2008 2:50 PM |
Take a look at this thread, you might find something. There are a lot of WCF related problems in beta 2. Not a single solution can fix them all. You have to find one for yourself. By the way, you said your service call had no problem in SL 1. Have you tried it in SL2 beta 1? Or you meant it worked fine in beta 1?
http://silverlight.net/forums/t/17733.aspx
06-11-2008 2:59 PM |
I looked at your error message again. You might want to check your ServiceRefrence.ClientConfig file to see anything strange there, can you see any invalid Tag in that file? That file is used by ServiceClient in beta 2. In beta1, this file is not used.
You can try to delete your ServiceReference first, make sure the ClientConfig file is empty. Then re-add the ServiceReference back and try it.
kobyb
4 Posts
06-12-2008 3:37 AM |
Hi,
I get the same problem as @sunraybrett and @KevD - The remote server returned an unexpected response: (404) Not Found
Here is a print screen of the HTTP log:
Thanks,Koby
06-12-2008 6:52 AM |
i clear the config and re-add the service, but i still have the same error:
here goes my clientconfig
slapadapter it works weel on silverlight 2 beta 1, but not in beta 2, could it be the instalation file?
06-12-2008 7:28 AM |
06-12-2008 10:13 AM |
Rui-Marinho,How did you create the customBinding ? I put that section in my .ClientConfig file I can see <customBinding> Tag is invalid. I think that is your problem. I did not even see where you use that binding. You are using DataServiceSoap which is the basicHttpBinding. I think current Silverlight still just support basicHttpBinding. Try to remove that customBinding and try it.
06-12-2008 11:24 AM |
its working, i deleted the custombinding and it works, but evry time i do update service the clientconfig adds that custombinding, so its from my webservice right? because it is asmx????
thanks once again slapadapter :)
06-12-2008 11:42 AM |
I don't know why VS added some invalid tag in the clientconfig. You might want to report that as a bug in bug forum and see if they have some explanation.
The work around would be not relying on the clientconfig file. Just set the address and binding in the code, just like we did in beta 1. Otherwise you have to keep modifying your clientconfig all the time until they fix that bug.
System.ServiceModel.BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding(); //If you want to specify non default message size, you can do it binding.MaxReceivedMessageSize = 2147483647; // int's max size , (those two lines are optional, depending your need.) binding.MaxBufferSize = 2147483647; // int's max size
System.ServiceModel.EndpointAddress address = new System.ServiceModel.EndpointAddress(new Uri(Application.Current.Host.Source, "../YourService.svc"));
var webService = new YourService.YourSeviceClient(); // this is the default constructor, it will read binding and address from the config file, do not use this one
var webService = new YourService.YourSeviceClient(binding, address);
So it will bypass the clientconfig reading.
06-13-2008 3:17 AM |
Just thought I'd give a quick update: my problem is solved!
I was using a (correct) crossdomain.xml-file. I changed this to clientaccesspolicy.xml and pasted the correct xml into 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="/" include-subpaths="true"/> </grant-to> </policy> </cross-domain-access></access-policy>
... and all of a sudden, my WCF-calls work again! Don't know why the crossdomain.xml-file isn't supported anymore, but: problem solved!
Tnx for the help guys!
RodKestler
10 Posts
06-20-2008 1:37 PM |
Also, to supplant sladapter's information, here are the size and version stamps for each version of Microsoft.VisualStudio.ServicesProxy.dll:
The incorrect version is:
Version: 9.0.21116.54
Size: 56.0 KB
The correct version (after removing and reinstalling Silverlight 2 Beta 2 Toolkit for Visual Studio 2008) is:
Version: 9.0.21022.108
Size: 36.0 KB
german00
06-25-2008 11:13 AM |
Excelent Work
Excelente, Funciona !!!!!
tom.winans
09-19-2008 3:59 PM |
I see this on Win 2K8 ...
09-21-2008 1:17 PM |
Tom, can you provide a little more information about the problem you're encountering?
umarkash...
44 points
14 Posts
10-24-2008 5:57 AM |
I think, you should use the WCF service instead of WCF-silverlight enable one.It is more easy to understand.Like RPC work in Java platform.It will make one interface for function prototyping and one class for implementation of those functions. Thanks