Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Locked Web service in a subfolder of an asp.net web site

  • Tuesday, July 31, 2012 11:24 AM
     
      Has Code

    I wonder if someone might be able to point me in the right direction.  I have an asp.net website hosted on shared hosting which works just fine.  I have written a web application which contains a web service.  This works fine on my development machine, and works fine if I publish the files to the root of my shared hosting.  However I would like to "install" this web service into the existing website.  To make it easier for updates, I thought that the best way to do this would be to create a subfolder within the web hosting and publish my web service files to it.  Obviously (now) this does not work.  It appears that I can put my asmx file anywhere I like but the compiled files must go into the websites bin folder.  I have read that I can use the following example config to add further references to folder which contain compiled code:-

      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="bin;WebServices/bin;" />
        </assemblyBinding>
      </runtime>

    This does not work for me however, giving the following error message when browsing to the asmx file:-

    Parser Error Message: Could not create type 'ContentManagementWebServices.Products'.

    What am I doing wrong?  Many thanks in advance.


    Alan Moseley

All Replies

  • Tuesday, July 31, 2012 4:08 PM
    Moderator
     
     
    Generally, it's best to create a separate web application. Is that a problem for you?

    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

  • Wednesday, August 01, 2012 10:23 AM
     
     
    It is already a separate web application from a project development perspective, that was my whole point.  If you mean that I need to create a new application folder on IIS then this is a problem as I am not in control of the hosting.

    Alan Moseley

  • Thursday, August 02, 2012 6:11 PM
    Moderator
     
     
    That's the problem. You can only have one application per bin folder.

    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

  • Friday, August 03, 2012 7:48 AM
     
     
    Hence my original question, can (and how do) you add an addition bin folder?

    Alan Moseley

  • Friday, August 03, 2012 3:20 PM
    Moderator
     
     Answered
    Hence my original question, can (and how do) you add an addition bin folder?

    You don't.

    If your hosting provider permits you access to IIS, then create a new application from a virtual folder under the main application. Otherwise, you're out of luck, and won't be able to use a separate project for the web service.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

    • Marked As Answer by Alan Moseley Thursday, October 18, 2012 10:33 AM
    •