.NET Web服务"无法创建类型" [英] .NET Web Service "Could not create type"

查看:180
本文介绍了.NET Web服务"无法创建类型"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的标记和code-背后对我的.NET Web服务的文件内容如下(pretty的VS产生多少东西):

The markup and code-behind file contents for my .NET Web Service are as follows (pretty much what VS generated):

Services.asmx:

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

Services.asmx.vb:

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class Services
    Inherits System.Web.Services.WebService

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

当我尝试访问Web服务,我得到:

When I try to access the web service, I get:

分析器错误信息:无法创建类型为服务

我已经试过排位赛的服务类规范在一个命名空间中的标记,但没有成功。

I've tried qualifying the Services class specification in the markup with a namespace, to no avail.

当我把code-落后于同一个文件中的.asmx,一切工作正常。

推荐答案

所以,当我构建配置更改为任何CPU,它的工作原理是因为包含类型的.dll文件结束了在bin文件夹中。当构建配置设置为86,该.dll仅在任斌/ 86 /调试或斌/ 86 /发布,其中IIS看起来并不结束了。那是愚蠢还是什么?我失去了一些东西?

So when I change the build configuration to Any CPU, it works because the .dll containing the type ends up in the bin folder. When the build configuration is set to x86, the .dll ends up only in either bin/x86/Debug or bin/x86/Release, where IIS doesn't look. Is that stupid or what? Am I missing something?

这篇关于.NET Web服务&QUOT;无法创建类型&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆