Asp.net 如何在IIS上提供已编译的web服务?

Asp.net 如何在IIS上提供已编译的web服务?,asp.net,web-services,iis,Asp.net,Web Services,Iis,我只得到了一个带有.asmx的文件夹和以前编译的带有DLL的/bin文件夹。我试图在本地计算机上运行此web服务,但出现错误 到目前为止,我做了以下工作: 已安装的IIS 在IIS中的“默认网站”下创建了应用程序“myWebService” 指向c:\inetpub\wwwroot\myWebService 当我浏览到 HTTP错误404.3-找不到您请求的页面无法访问 由于扩展配置而被服务。如果页面是 脚本,添加一个处理程序。如果应该下载该文件,请添加MIME 地图 据我所知,404.3错误意

我只得到了一个带有
.asmx
的文件夹和以前编译的带有DLL的
/bin
文件夹。我试图在本地计算机上运行此web服务,但出现错误

到目前为止,我做了以下工作:

  • 已安装的IIS
  • 在IIS中的“默认网站”下创建了应用程序“myWebService”
  • 指向c:\inetpub\wwwroot\myWebService
  • 当我浏览到

    HTTP错误404.3-找不到您请求的页面无法访问 由于扩展配置而被服务。如果页面是 脚本,添加一个处理程序。如果应该下载该文件,请添加MIME 地图


    据我所知,404.3错误意味着当请求到达IIS时,没有处理程序可以处理asmx文件

    我建议您首先检查应用程序的处理程序映射中是否有webservicehanlderfactory。

    如果没有这样的处理程序映射,我建议您可以尝试下面的解决方案来安装它

    对于服务器:

    转到服务器管理器>添加角色和功能从服务器池中选择服务器转到功能>WCF服务我选择了所有类别,然后安装

    对于Windows 10:

    打开控制面板>Windows功能>选择IIS>万维网服务并启用以下设置:

    此外,如果您想在IIS上托管asmx,还应该具有正确的web.config文件

    我建议您可以要求提供商获取配置文件。如果您没有得到它,您就无法很好地运行web服务

    Web.config示例:

    <?xml version="1.0"?>
    <configuration>
    
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
      </appSettings>
      <system.web>
        <compilation debug="true" targetFramework="4.8" />
        <httpRuntime targetFramework="4.8"/>
      </system.web>
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <protocolMapping>
            <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>    
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
        <!--
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
          -->
        <directoryBrowse enabled="true"/>
      </system.webServer>
    
    </configuration>
    

    您看到了吗?谢谢您的详细回答。我唯一需要做的就是打开ASP.NET功能