Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8411235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:23:09+00:00 2026-06-10T00:23:09+00:00

I have two projects: Mvc3TestSvcRef & Mvc4TestSvcRef. Mvc3TestSvcRef is from the ASP.NET MVC 3

  • 0

I have two projects: Mvc3TestSvcRef & Mvc4TestSvcRef.
Mvc3TestSvcRef is from the ASP.NET MVC 3 template for an intranet application.
Mvc4TestSvcRef is from the ASP.NET MVC 4 template for an intranet application.

I’m trying to add a service reference.
In Mvc3TestSvcRef, I right-click the project (or the References folder) and choose Add Service Reference. I point to the URL, click Go. When the reference is resolved, I enter a namespace and click OK. As expected, I see the section added to config with the bindings and client tags completed.
I can import: “using Mvc3TestSvcRef.MySvcRef;”
And write code like:

        using (var cl = new MyServiceClient())
        {
            cl.DoStuff();
        }

In Mvc4TestSvcRef, I follow the same steps, but there is no system.servicemodel added to config. Additionally the import: “using Mvc4TestSvcRef.MySvcRef;” cannot be resolved.
I’ve tried this for MVC 4 from both Visual Studio 2010 and Visual Studio 2012.

Was there a major change to the process for adding service references in ASP.NET MVC 4 project type, or am I missing something or have corrupt install?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:23:10+00:00Added an answer on June 10, 2026 at 12:23 am

    There was no code in Reference.cs, just comments:

    //------------------------------------------------------------------------------
    // <auto-generated>
    // This code was generated by a tool.
    // Runtime Version:4.0.30319.17929
    //
    // Changes to this file may cause incorrect behavior and will be lost if
    // the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------
    

    I copied the reference.cs from the project that worked and modified the namespace, then added the section from the working project into the MVC 4 project and was still having an issue.

    I tried to build and I got several warnings and an error. Failed to generate code for the service reference ‘MySvcRef’. Please check other error and warning messages for details.

    That led me to this article: Service Reference Error: Failed to generate code for the service reference

    So I unchecked the Reuse types in all referenced assemblies from the Advanced section.

    This seems to have generated a good service reference. Although, I should point out that if you have something in say System, like System.TimeSpan for example, that is used as a DataMember in one of your DataContracts, the reference will now have TimeSpan in the reference namespace, not from it’s origin. So, the client would see any System.Timespan properties as ReferenceNameSpace.Timespan, which may throw off comparisons and such. The better answer here is to include specific assemblies from the reference and don’t check the box for System.Web.Http, as pointed out in the comments below

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two projects.One project is build in MVC asp.net and the other project
I have two projects in the same solution. One is an ASP.NET MVC 2
I have two projects in my solution   1- asp.net web project.   2-
i have two projects Evolet.Domain and Evolet.Web in my solution where Evolet.Web is asp.net
I have two projects: ASP.Net 3.5 website (frontend, UI) VB Class Library (dataaccess logic)
I have two projects: a profiler and a basic application (with JUnit tests) The
I have two projects in an Xcode workspace. I would like to add the
I have two projects in my solution, an MVC 3 (UI) project and a
I have two projects in my solution. The first project is a WPF application,
i have two projects in eclipse and i want to copy some files from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.