Visual Studio 2012 Error Reference.svcmap throwing Error
Asked Answered
E

3

7

Started using Visual Studio 2012 RC since yesterday, We have one WCF solution. Whenever i try to use the "add/remove reference" dialog in another solution, I get below error after adding the service.

Error 1 Reference.svcmap: Failed to generate code for the service reference 'DPService'. Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Type 'WebSupergoo.ABCpdf8.Objects.Bookmark' is a recursive collection data contract which is not supported. Consider modifying the definition of collection 'WebSupergoo.ABCpdf8.Objects.Bookmark' to remove references to itself. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IGQDynamicPackaging'] Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IGQDynamicPackaging'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='WSHttpContextBinding_IGQDynamicPackaging'] Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='WSHttpContextBinding_IGQDynamicPackaging'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='GQService']/wsdl:port[@name='WSHttpContextBinding_IGQDynamicPackaging'] App_WebReferences/DPService/

Please note that : The said service was working properly when i used VS 2010. For your reference, We are using "Reuse types in referenced assemblies " turned on and "reuse types in all referenced assemblies" option checked.

The same settings was working ok with VS 2010 and we can add reference . But now, After installing VS 2012 RC , I can't able to add the reference for both of the VS 2010 and VS2012. Any soluton or work around for this.

I just want to rollback and want to use VS2010, "add service " gives the same reference error in VS 2010 now.

Eke answered 20/6, 2012 at 4:46 Comment(5)
I am uninstalling vs 2012 and will uninstall .net 4.5, did you try to do this? was it useful?Marrowbone
Hi MSS, We didnot try to uninstall that yet. Do you get any success after uninstall ? Appreciate your input on this.Eke
Uninstalled, but vs 2010 corrupted, re installed vs 2010 (repaired) and trying to see what happened!!!Marrowbone
Yeeaaaaaaaaaaah, it is ok now!Marrowbone
I just had this problem and found that I hadn't added the Visual Studio update 2. After installing the update and restarting my pc it seems ok nowWall
M
1

Uninstall vs 2012, vs 2010 will give you "Unknown error", a small error message, repair vs 2010 (re-install it), and it will be OK!

Marrowbone answered 21/6, 2012 at 8:27 Comment(5)
i do not understand why uninstall vs 2012 then install vs 2010 then re install 2012Irreclaimable
i have the same problem by the wayIrreclaimable
I mean: re-install vs 2010 and not vs 2012, the problem caused vs 2010 not to work! so, i repaired it after uninstalling vs 2012.Marrowbone
I found another solution for the same problem hope it works you can easily right click in your service reference and then select configure and unchecked the reuse type in referenced assemblies it will workIrreclaimable
But what if I need to reuse type in referenced assemblies??!Marrowbone
P
43

I had a similar problem and I unchecked the "Reuse Types in referenced assemblies" checkbox in the Configure Service reference dialog.

1) Right click on Service Reference 2) Select Configure Service Reference 3) Uncheck "Reuse types in referenced assemblies"

I'm not sure of all of the ramifications of doing this but it got me through to be able to use the reference again.

Petras answered 20/6, 2012 at 22:3 Comment(6)
In our case, we need to use the "referenced assembly" option since we have separate asssembly which share the types between wcf and web. Notable Point is that we have done lot of coding using the reference assembly. changing all of them back to refer to generated proxy is really nightmareEke
The ramification are that you do not reuse types and it generates a new set of classes for each of your model objects. Fine if they are pocos but sucks if you have say validation shared across client and server. The odd thing is that one user was installing sp1 and things went funny. That somehow effected my machine ... unticking reuse, updating and then turning it back on and everything behaved again.Ascariasis
This "worked" for me too, but I shouldn't have to make this change in VS 2010 just because VS 2012 is broken. Is there a way to actually fix this?Intemperate
in VS2012 don't uncheck the entire "Reuse Types in referenced assemblies" but rather just uncheck anything that is not core-microsoft.Relevant
the configuration dialog is not accesible. I get an error stating, that vs is not able to locate .net frameworkBridgman
The problem with doing this is then all the Service method parameters have the Namespace of the Service - not say a shared namespace. So if your passing an object in it likely doesn't match the parameters namespace. Also generates tons of "Ambiguous" reference errors.Pedal
M
4

It looks like the 'CustomerServiceReference' has been defined in two assemblies referenced by your project. The code generator has no idea about which one should be used.

To get rid of this problem, just like Lars said. You can configure your service reference, in its advance options tab, you can disable "reuse types in all referenced assemblies", (by select "reuse types in specified referenced assemblies"). You can select all assemblies except the assembly causing this problem (which defines the CustomerServiceReference as the error message said.)

Moseley answered 28/10, 2013 at 8:1 Comment(0)
M
1

Uninstall vs 2012, vs 2010 will give you "Unknown error", a small error message, repair vs 2010 (re-install it), and it will be OK!

Marrowbone answered 21/6, 2012 at 8:27 Comment(5)
i do not understand why uninstall vs 2012 then install vs 2010 then re install 2012Irreclaimable
i have the same problem by the wayIrreclaimable
I mean: re-install vs 2010 and not vs 2012, the problem caused vs 2010 not to work! so, i repaired it after uninstalling vs 2012.Marrowbone
I found another solution for the same problem hope it works you can easily right click in your service reference and then select configure and unchecked the reuse type in referenced assemblies it will workIrreclaimable
But what if I need to reuse type in referenced assemblies??!Marrowbone

© 2022 - 2024 — McMap. All rights reserved.