none
Ambiguous reference errors after upgrading from VS2010 to VS2012 RRS feed

  • Question

  • Hello,

    I have a solution that contains a project with some WCF services, and projects with client apps that consume those services. These include a WPF app and an ASP.NET MVC3 web site. This all worked fine in VS2010.

    I have just opened the solution in VS2012, and the WPF app works fine. However, I have a problem with the web site, in that all of the entity classes used in the controllers throw compiler errors of ambiguous reference...

    I have the entity classes in a class library, so they can be shared between all server and client projects. I have configured the service reference in the web project to reuse the types in the class library, as opposed to the ones in the service reference...

    This is the same configuration as was in VS2010, and is the same as for the service references in the WPF project, but as I showed earlier, I get an ambiguous reference error.

    I tried adding "using" statements to tell the compiler explicitly to use the types in the class library, but that gave errors trying to get the data from the service calls, as they are stubbornly using the types defined in the service. I can't tell it to use the types in the service references, as there are four different services references in the project, and many of the classes are used by more than one service. This causes compiler errors when the types don't match.

    Anyone any idea what went wrong here? It all worked absolutely fine in VS2010, and the configuration is set up the same as it was, but it will not reuse the types in the class library.

    Thanks for any help.


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers. Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Tuesday, July 2, 2013 3:12 PM

All replies

  • Try if unchecking "Reuse types in referenced assemblies" in settings (in your image) solve the problem.

    Gaurav Khanna | Microsoft VB.NET MVP | Microsoft Community Contributor

    Tuesday, July 2, 2013 7:00 PM
  • Hi Gaurav, thanks for the reply.

    I tried that, but it didn't make any difference.

    Any other ideas? Thanks again.


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers. Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Tuesday, July 2, 2013 7:08 PM
  • Anyone? This is crippling my development.

    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers. Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Thursday, July 4, 2013 8:27 AM
  • Your question falls into the paid support category which requires a more in-depth level of support. Please visit the below link to see the various paid support options that are available to better meet your needs.

    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Friday, July 5, 2013 7:46 PM
  • Your question falls into the paid support category which requires a more in-depth level of support. Please visit the below link to see the various paid support options that are available to better meet your needs.

    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    WHAT????

    I opened a solution that works fine in VS2010, and it breaks, without me changing a thing, and the only advice you can offer is that I have to pay Microsoft big bucks to fix their upgrade issues.

    Thanks for nothing. Maybe I'll stick with VS2010.


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers. Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Sunday, July 7, 2013 1:45 PM
  • Your question falls into the paid support category which requires a more in-depth level of support. Please visit the below link to see the various paid support options that are available to better meet your needs.

    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    So is that it? Either I pay up for the privilege of having Microsoft fix the problems that their software has caused, or I have to ignore VS2012 altogether? No exactly very helpful or friendly is it?

    To repeat, this problem was caused by nothing more than me taking a solution that works absolutely fine in VS2010, and opening it in VS2012. I didn't touch a thing, and yet I'm not offered even the slightest bit of support from Microsoft, and am told that I have to pay for you to fix the problems that you have caused.

    Don't you think that's just a little unfair?


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers. Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Thursday, July 11, 2013 2:42 PM
  • Probably you can try following link

    https://connect.microsoft.com/


    Gaurav Khanna | Microsoft VB.NET MVP | Microsoft Community Contributor

    Friday, July 12, 2013 9:33 AM
  • Hi Gaurav, thanks for the suggestion. I might give it a try, but my previous experience of Connect doesn't fill me with hope.

    I still feel very annoyed that Microsoft can take such an arrogant attitude. At least some effort to help wouldn't have hurt them.


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers. Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Sunday, July 14, 2013 9:58 PM
  • Hello mr yossu, have you solved this problem. i'm experimenting the same tring an upgrade from vs 2010 to vs 2013.

    My shared silverlight library and the wcf duplacate all my binding classes.

    Bye

    Thursday, March 5, 2015 9:02 AM
  • I did solve it eventually (no thanks to Microsoft!). I think I ended up deleting the service reference and adding it again. Not sure, but that was certainly one of the things I did.

    Hope that helps.


    FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers (Silverlight client only). Download from the Visual Studio Gallery.

    If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies at http://dotnetwhatnot.pixata.co.uk/

    Sunday, March 8, 2015 3:51 PM
  • I'm experimenting the same issue when upgrade from vs 2010 to vs 2015. Also delete the service references and add them again like you did, but not resolved.

    Tuesday, September 15, 2015 6:56 AM
  • Hi Mr Yossu,

     I want to ask you that did you get this issue solution. please tell i am also gating same issue.

    Please help me if you got solution 

    Thank you 

    Gaurav Jain

    Monday, June 11, 2018 6:29 AM