locked
web service reference failing after .net 4.5 upgrade with VS 2012 install RRS feed

  • Question

  • I have a project that is receiving the "The type or namespace '' does not exist in the class or namespace ''" error.

    The site was downloaded via TFS and I'm using VS 2012. I've configured the site to run locally through IIS 7.5. The project build has a target framework of 4.0 because it was built in 4.0 framework environment using Visual Studio 2010.

    Loading the site in the browser results in your standard 500 - Internal Server Error. I've checked the Event Viewer and this is the the error along with the stack trace :

    c:\inetpub\wwwroot\Jet_Distrib_US\App_Code\CSCode\WM_WebServiceHelper.cs(40): error CS0234: The type or namespace name 'WM_Get_SoldToRequest' does not exist in the namespace 'WM_JetService' (are you missing an assembly reference?) at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) at System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) at System.Web.Compilation.BuildManager.CompileCodeDirectories() at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
    at System.Web.Compilation.BuildManager.CallAppInitializeMethod() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

    WM_JetService is set in the Web_References folder of the project.

    As an example of one of the errors I am seeing in WM_WebServiceHelper.cs is:

    using (WM_JetService.JetServiceSoapClient WMService = new WM_JetService.JetServiceSoapClient()) { WM_JetService.WM_Get_SoldToRequest request = new WM_JetService.WM_Get_SoldToRequest(); ... }

    (I'm getting the red error indicators beneath "WM_Get_SoldToRequest").

    I can create an instance of WM_JetService but for some reason, I can't reference any of it's methods or properties.

    This code works fine for the client locally where it was developed. I cannot get it to run on my machine locally though. I've uninstalled framework 4.5 and reverted back to 4.0.. and the site would load properly.    Is there any way to get this to run and develop safely using VS 2012 and deploy to a .net 4.0 environment????

    Any help would be greatly appreciated.

    Thursday, December 13, 2012 3:50 PM

All replies

  • Is this a web site "Project" (File->New Web Site), or a web application project (File->New Project)? It makes a big difference.

    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

    Thursday, December 13, 2012 9:59 PM
    Moderator