none
Can't reference external assembly from my WCF service RRS feed

  • Question

  • I can't reference an external assembly from my WCF service. I keep getting the error "The type or namespace name "" could not be found...

    So for example, I have a DLL in which I have a class called Product, and a WCF service called ProductsWCFConnector which references the DLL. An operation contract in the wCF service takes the Product type as an input, but no matter what I do, I get the error above. The service sees the Product type as it is in colour, but when I build, I get the error that it cannot find the type, or that the type doesn't exist in the namespace. Am I expected to create POCO classes of Product? I can almost swear I have done this before without any extra steps?


    • Edited by dotunex Wednesday, February 11, 2015 6:15 PM
    • Moved by Kristin Xie Thursday, February 12, 2015 5:19 AM
    Wednesday, February 11, 2015 6:14 PM

Answers

  • Hi,

    Check to make sure that your project isn't set up to use the .NET Framework 4 Client Profile.

    You can check/change this by right-clicking your project (not the solution), select Properties -> Application -> Target framework.  The target framework is a dropdown on that page.

    AutoMapper requires assemblies that are excluded from the .NET Framework 4 Client Profile.  Since your project is using that version of the framework it breaks.

    For more information, you could refer to:

    http://stackoverflow.com/questions/4228992/namespace-not-recognized-even-though-it-is-there

    Regards

    • Marked as answer by dotunex Thursday, February 12, 2015 7:54 AM
    Thursday, February 12, 2015 7:14 AM
    Moderator

All replies

  • Hi ,

    Your case related to WCF service. I will move your thread to WCF forum for better support.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 12, 2015 5:19 AM
  • Hi,

    Check to make sure that your project isn't set up to use the .NET Framework 4 Client Profile.

    You can check/change this by right-clicking your project (not the solution), select Properties -> Application -> Target framework.  The target framework is a dropdown on that page.

    AutoMapper requires assemblies that are excluded from the .NET Framework 4 Client Profile.  Since your project is using that version of the framework it breaks.

    For more information, you could refer to:

    http://stackoverflow.com/questions/4228992/namespace-not-recognized-even-though-it-is-there

    Regards

    • Marked as answer by dotunex Thursday, February 12, 2015 7:54 AM
    Thursday, February 12, 2015 7:14 AM
    Moderator
  • You're a star! that wasn't the problem, but it was close enough. One project was using .Net Framework 4.5 and the other was using .Net framework 4.5.1... One would think that they would still reference each other just fine... Changed both to 4.5.1 and both built like a charm... This cost me 2 days!!

    Thursday, February 12, 2015 7:54 AM