tags:

views:

1167

answers:

2

I have a web application on ASP.NET (C#) that has some precompiled components. I've been supporting it with no problems from quite sometime, adding features and extending. Right now I am facing another extension that requires calling a remote SOAP service.

I've tried doing it according to some recommendations that I got here - via adding Web Reference, creating proxy class and all that, but Visual complains that app is precompiled.

Here is the actual output of compiler:

The directory '/trxv/App_WebReferences/' is not allowed because the application is precompiled. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The directory '/trxv/App_WebReferences/' is not allowed because the application is precompiled.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The directory '/trxv/App_WebReferences/' is not allowed because the application is precompiled.]
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +8805619
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +128
System.Web.Compilation.BuildManager.CompileWebRefDirectory() +31 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +312

[HttpException (0x80004005): The directory '/trxv/App_WebReferences/' is not allowed because the application is precompiled.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729

[HttpException (0x80004005): The directory '/trxv/App_WebReferences/' is not allowed because the application is precompiled.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8886319
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259

Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

Are there any other more or less simple(i.e. high level) methods of calling SOAP client, that would not require recompilation? Unfortunately original source code for the system is not available.

+1  A: 

Alex,

Note my most recent edit. The issue has to do with the fact that you do not have a Web Application - you have a Web Site. They are unique, and strange.

I never use them unless I have to, so I've actually never seen this exception. It does seem rather final, though. So here's how you'll have to fix this:

Create a separate class library project. Add the web reference to the class library, and build it. Then, see if you can reference the class library in your web pages. The class library should contain the proxy classes.

John Saunders
John, that's a great idea! Thanks a lot!I will do that and see what happens :)Will keep this question open, just in case.
Alex N.
A: 

Hi,

I've the same problem, and I would like to conservate the WebReference in the presentation layer,

some help?

Thanks

Miguel