首页 > 解决方案 > 无法在 localhost 上使用 vb 创建类型“myProject.Service1”

问题描述

我试图在我的 IIS 管理器中托管一个 Web 服务,但我收到了这个错误:

An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

我读到当我更改类的名称并且不在标记中更改它时会发生这种情况,但是我都改变了

Public Class Service1
    Inherits System.Web.Services.WebService


    <WebMethod()> _
    Public Function HelloWorld() As String
        Return "Hello World"
    End Function

源错误状态

Line 1:  <%@ WebService Language="VB" CodeBehind="Service1.asmx.vb" Class="myApp.Service1" %>

我的标记

<%@ WebService Language="VB" CodeBehind="Service1.asmx.vb" Class="myApp.Service1" %>

我所阅读的所有内容似乎都引用了不匹配的名称,但我已将所有默认设置保留为防止此问题,但我仍然遇到相同的问题。

标签: vb.netiis

解决方案


您需要在进行更改后构建应用程序,然后再次发布应用程序。


推荐阅读