views:

63

answers:

2

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/")&gt; _
<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

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

Parser Error Message: Could not create type 'Services'

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

When I put the code-behind in the same file as the .asmx, everything works fine.

A: 

I would say it's a problem related with the class name matching a namespace. Have you tried renaming the Services class to something else?

Anero
I tried renaming the class. I also just added a new "Web Service" to the project through VS. It named it WebService1.asmx. I didn't touch any of the generated code in it, but "http://localhost/WebService1.asmx" also yields the same error.
Hans
A: 

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?

Hans