locked
Could not create type Webservice error RRS feed

  • Question

  • User1180806401 posted

    Hi Guys,

    I've created a very simple webservice and its runs fine in my local development machine, but when deploying in IIS and running it online I get "Could not create type WebService"

    <%@ WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" Class="WebService" %>

    I also tried adding the project name to class name but still get the same error

    <%@ WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" Class="cvDesktop.WebService" %>

    any help please?

    thanks

    Sunday, December 17, 2017 6:20 AM

All replies

  • User1564875471 posted

    How you do the deployment to the IIS? are you copying the code as is to the IIS folder ? or using the Build->Publish menu?  BTW, did you created application under IIS for your site ? 

    Sunday, December 17, 2017 9:20 AM
  • User1180806401 posted

    In IIS Under default websites -->Add application, and defined alias load path...etc where the physical location of my application is in wwwroot.

    if i run the webservice from the browser in the local machine it works fine but we also have have that server available online on a specific port where we already have some websites already running online, BUT not the case with this webservices!?

    Thanks  

    Sunday, December 17, 2017 11:08 AM
  • User1168443798 posted

    Hi rbadis,<o:p></o:p>

    >> if i run the webservice from the browser in the local machine it works fine but we also have have that server available online on a specific port where we already have some websites already running online, BUT not the case with this webservices!?<o:p></o:p>

    Do you mean the asmx service works when you access it from local browser but failed from remote after publishing it to IIS? Did you mean you get this error “could not create type error” from remote, but not in the local?<o:p></o:p>

    If so, it would be strange. For this error message, it is usually related with that we changed the service name file like renaming service1.asmx to service2.asmx, but we did not change the code behind.<o:p></o:p>

    Based on your description, it works under local environment.<o:p></o:p>

    >> where the physical location of my application is in wwwroot.<o:p></o:p>

    Did you copy your project to wwwroot? Did you get any error if you access the .asmx file from remote?<o:p></o:p>

    I suggest you follow these steps, Run VS under administrator-> Project Property-> Change IIS Express to IIS-> Create Virtual Directory-> Access it from IIS, will you receive any error?<o:p></o:p>

    I would suggest you share us your simple project, and detail steps to reproduce your issue.<o:p></o:p>

    Best Regards,<o:p></o:p>

    Edward<o:p></o:p>

    Monday, December 18, 2017 2:55 AM