简体   繁体   English

在IIS 6.0中启动Web服务(.asmx)

[英]launching a web service (.asmx) in a IIS 6.0

I have developed a web service with the .asmx extension using C# and i want to deploy this into my VPS which has Windows Server 2003 with IIS 6. 我已经使用C#开发了一个扩展名为.asmx的Web服务,并且希望将此服务部署到具有IIS 6的Windows Server 2003的VPS中。

Service is running with Framework 4.0 and it's installed in the VPS also. 服务与Framework 4.0一起运行,并且也安装在VPS中。 When I upload the precompiled version into the VPS it shows a runtime error 当我将预编译的版本上传到VPS时,显示运行时错误

Server Error in '/' Application. '/'应用程序中的服务器错误。

Runtime Error 运行时错误

Description: An application error occurred on the server. 说明:服务器上发生应用程序错误。 The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). 该应用程序的当前自定义错误设置阻止应用程序错误的详细信息被远程查看(出于安全原因)。 It could, however, be viewed by browsers running on the local server machine. 但是,可以由运行在本地服务器计算机上的浏览器查看它。

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. 详细信息:若要使此特定错误消息的详细信息在远程计算机上可见,请在当前Web应用程序根目录中的“ web.config”配置文件中创建一个<customErrors>标记。 This tag should then have its "mode" attribute set to "Off". 然后,此标记应将其“mode”属性设置为“Off”。

<!-- Web.Config Configuration File -->

 <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration> 

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL. 注意:通过修改应用程序<customErrors>配置标记的“ defaultRedirect”属性以指向自定义错误页面URL,可以将当前看到的错误页面替换为自定义错误页面。

<!-- Web.Config Configuration File -->

 <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> 

can anyone help me on this? 谁可以帮我这个事?

Update 更新

Server Error in '/' Application. '/'应用程序中的服务器错误。

Configuration Error 配置错误

Description: An error occurred during the processing of a configuration file required to >service this request. 说明:在处理服务于此请求所需的配置文件期间发生错误。 Please review the specific error details below and modify your >configuration file appropriately. 请查看下面的特定错误详细信息,并适当修改>配置文件。

Parser Error Message: Unrecognized attribute 'targetFramework'. 解析器错误消息:无法识别的属性'targetFramework'。 Note that attribute names >are case-sensitive. 请注意,属性名称>区分大小写。

Source Error: 来源错误:

Line 26: Line 27: 第26行:第27行:
Line 28: Line 29: Line 30: Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 第28行:第29行:第30行:文化=中性,PublicKeyToken = 31BF3856AD364E35“ />

Source File: C:\\Inetpub\\vhosts\\akashvahini.com\\httpdocs\\web.config 源文件:C:\\ Inetpub \\ vhosts \\ akashvahini.com \\ httpdocs \\ web.config
Line: 28 行:28

Version Information: Microsoft .NET Framework Version:2.0.50727.3053; 版本信息:Microsoft .NET Framework版本:2.0.50727.3053; ASP.NET >Version:2.0.50727.3053 ASP.NET>版本:2.0.50727.3053

this is the new error message after enabling debugging in the web.config 这是在web.config中启用调试后的新错误消息

You should enable debugging to diagnose the problem. 您应该启用调试以诊断问题。
Microsoft has a very detailed explanation on how to enable detailed debugging over here . Microsoft对如何在此处启用详细调试有非常详细的说明。

Server Error in '/' Application.

That error is too generic, check the output after you enabled debugging and post the results. 该错误过于笼统,请在启用调试后检查输出并发布结果。
And don't forget to disable debugging after your site goes live. 并且不要忘记在网站上线后禁用调试。

Update : 更新
Seems to be permission related: 似乎与许可相关:
http://forums.iis.net/p/1042369/1454379.aspx http://forums.iis.net/p/1042369/1454379.aspx
The ASPNET user account needs permissions for the folder that contains your asmx service. ASPNET用户帐户需要对包含您的asmx服务的文件夹的权限。

Update2 : You can give the ASPNET user permissions using the file system permission dialog: Update2 :您可以使用文件系统权限对话框授予ASPNET用户权限:
http://www.asp.net/learn/whitepapers/denied-access-to-iis-directories http://www.asp.net/learn/whitepapers/denied-access-to-iis-directories

Might look different on newer versions of Windows. 在较新版本的Windows上可能看起来有所不同。

From my experience "Server Application Unavailable" means that you have got web sites that use different versions of .net in the same application pool. 根据我的经验,“服务器应用程序不可用”表示您在同一应用程序池中拥有使用不同版本的.net的网站。

the site that hosts your webservice needs to be in an app pool that only has .net 4.0 web sites. 托管Web服务的站点必须位于仅具有.net 4.0网站的应用程序池中。 The application pool is configured on the Home Directory tab in the web site properties. 在网站属性的“主目录”选项卡上配置应用程序池。

Looks to me like the application pool is trying to run two difference versions on .net. 在我看来,应用程序池正在尝试在.net上运行两个不同的版本。

Make a new application pool and call it something like .Net4 and then move the new site across to use this app pool and everything should work. 创建一个新的应用程序池,并将其命名为.Net4之类的名称,然后将新站点移至另一个位置以使用该应用程序池,并且一切正常。

This error is shown by Version Information: Microsoft .NET Framework Version:2.0.50727.3053; 版本信息显示此错误:Microsoft .NET Framework版本:2.0.50727.3053; ASP.NET >Version:2.0.50727.3053 ASP.NET>版本:2.0.50727.3053

Where the site with a .asmx should say .Microsoft .NET Framework Version:4.0 etc... 带有.a​​smx的网站应显示.Microsoft .NET Framework版本:4.0等...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM