我有一個ASP.NET(C#)上有一些預編譯組件的Web應用程序。我一直支持它,沒有任何問題,增加了功能和擴展。現在我正面臨另一個需要調用遠程SOAP服務的擴展。如何修改預編譯的ASP.NET網站? Visual Studio抱怨該網站已預編譯
我試着根據我在這裏得到的一些建議 - 通過添加Web引用,創建代理類和所有這些,但Visual抱怨應用程序是預編譯的。
以下是編譯器的實際輸出:
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) +259Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
是否還有其他或多或少簡單(即高級別)調用SOAP客戶端的方法,將不需要重新編譯?不幸的是,該系統的原始源代碼不可用。
我認爲你有一個更普遍的問題:如何擴展一個預編譯的網站,但你沒有源代碼。這不僅僅是一個Web服務問題。 – 2009-07-06 22:01:32
排序的事情是它有幾個組件,它使用的是預編譯和在主模板中使用。我沒有觸及那些。我只是創建一個新的頁面,用一個新的表單來做一些遠程SOAP調用...我可以一路下來打開HTTP連接並直接向服務交談XML,但是我希望.NET有一些更好/更智能的達到此目的的方法。 – 2009-07-06 22:05:10