locked
Problem accessing ServiceReference in Controller action method in MVC RRS feed

  • Question

  • User-1534620960 posted

    Problem 1:

    On computer Pro1: (Showing problem on this computer) See problem 2 for more information about this problem. I tried the project on computer called Arshad. Everything works fine on computer called Arshad.

    Problem is: I added a service reference by name ServiceReference1 in mvc project but I am unable to use the ServiceReference1 in controller action method and the intellisense does not show ServiceReference1 and the proxy class. What could be the problem? Is it issue with Visual Studio? I restarted VS2012 but the problem persists.

    Problem 2:

    On computer Arshad: (All things are working fine on Computer called Arshad)

    I created project in the following manner:

    On computer Pro1: (Showing problems here on this computer)

    Now I took the project and opened the project in computer called Pro1 with Visual studio and Sql installed.

    My Object Browser for this project looks something like this in Pro1 before I clicked on Update Service Reference:

    Able to create object of proxy class and invoke methods in the service.

    ServiceReference1 is available before updating the service reference

    After I clicked on Update Service Reference one file vanishes. (This is computer called Pro1) Name of this file vanishing is: MyMvcApplication.ServiceReference1

    Now inside the controller I cannot Access ServiceReference1 and proxy class is not available for me to work with the service.

    Showing error:

    Computer Pro1 is showing problems. Everything is working fine on computer called Arshad.

    Is there any setting that I need to change. What could be the problem. I am able to use ServiceReference1 in webforms as client but not in MVC client on Pro1 computer.

    Tuesday, October 1, 2013 2:42 AM

Answers

  • User-1534620960 posted

    I solved my problem by going to Add References->Advanced button->unchecked "Reuse types in referenced assemblies"->Ok

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 1, 2013 7:15 AM

All replies

  • User289622470 posted

    Hi,

       You might need to include "using" statement on top of the file which maps to the proxy class of the service. Can you check.?

    Thanks,

    Tuesday, October 1, 2013 5:26 AM
  • User-1534620960 posted

    I solved my problem by going to Add References->Advanced button->unchecked "Reuse types in referenced assemblies"->Ok

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 1, 2013 7:15 AM