I have a project that is receiving the "The type or namespace '' does not exist in the class or namespace ''" error. I've seen a lot of solutions here that haven't been able to solve my problem.
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.
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. Also, when I installed VS2012, it updated my framework to 4.5. Not sure if that has anything to do with this but I've made sure that my AppPool is set to 4.0 and that the project has a targetFramework of 4.0.
Could this be a configuration issue with IIS 7.5 or with VS 2012? Is there something else I'm supposed to do to get this web service reference to work locally??
Any help would be greatly appreciated.