-1

I have a solution with different projects in C#, including client and host communicating through a WCF service. I had initially build the solution using AnyCPU and everything worked great, I could Update Service Reference in the client without problem.

Now, some components in the project required to move everything to x86. I can still build the solution without error but when I click Update Service Reference I have an error saying "The URI prefix is not recognized. Metadata contains a reference that cannot be resolved..." I double checked and the app.config were identical before and after moving to x86.

Am I missing something or is this a bug in VS2019 ?

EDITS:

I forgot to mention, it is a Windows Service using net.pipe. And the error has actually nothing to do with the URI, it is really a x86 vs x64 problem. Actually I found this post also talking about a similar issue. After some troubleshooting, I actually found that the Platform target (in properties) of my WCF library was set to x86. Changing this to AnyCPU solved the problem, even though my Client and Host are still running in x86... I'd still like to understand what's the deal here... if everything is running x86 anyways, why changing platform target in the library mess up everything?

bricx
  • 593
  • 4
  • 18
  • 1
    did you check IIS AppPool settings? can it be that's still stuck with x64? – timur Aug 27 '20 at 00:38
  • Also posting the example of URI format that is complained about would help to check as well. – Siva Gopal Aug 27 '20 at 05:04
  • @timur: it is a Windows Service using net.pipe (not IIS). – bricx Aug 27 '20 at 15:34
  • @Siva Gopal: I did a bit of troubleshooting and edited the post. – bricx Aug 27 '20 at 16:41
  • You can try to use the channel factory to call the wcf service. – Ding Peng Aug 28 '20 at 06:47
  • You can also generate proxy classes through svcutil. For how to use svcutil, you can refer to this link:https://stackoverflow.com/questions/61631400/adding-wsdl-service-reference-to-vs-fail-because-generated-xsd-file-contains-ill/61725107#61725107 – Ding Peng Aug 28 '20 at 06:49

1 Answers1

0

I still haven't really understood the bottom of this issue but instead of having the WCF config in the App.config, I did the configuration programmatically. That seems to have solved the issue, now I can build in x86 no problem.

bricx
  • 593
  • 4
  • 18