Ok, I'm new to deploying web services and I'm running into a bit of an issue which I haven't been able to resolve scouring the internet. I'm hoping someone here has run into this and might have a solution which I haven't tried yet.

We are developing a web service which we will NOT be hosting; it will be installed on client web servers. For this reason we intend to obfuscate our code. I am obfuscating using Dotfuscator Community Edition. The problem that I have been running into despite trying every method I've found so far is:

Could not create type 'WebService.WebService'

'WebService.WebService' correctly refers to the class I intend it to access. The forums at Dotfuscator state that these rules are required for web services:

<type name=".*" regex="true">
<customattribute name="System.Web.Services.*" regex="true" />
<type name=".*" regex="true" excludetype="false">
<method name=".*" regex="true">
<customattribute name="System.Web.Services.*" regex="true" />

for any types and methods that inherit from System.Web.Services. I have implemented these rules in the Dotfuscator utility and excluded those classes from the obfuscation process.

Also, I found a few possible solutions which were to:

Make sure the .asmx file is set to content
Make sure the asmx.vb file is set to compile

And to verify the virtual directory is running ASP 2.0, which it already was.

I am able to build and install my webservice on the intended server and the methods are obfuscated from me when I use .NET Reflector on them, however, I still get the same error when I try to access the .asmx in my browser.

Finally, I don't know if this is even related but, I suppose it is worth mentioning. My process for obfuscation is this:

  • Build the Web Service
  • Run Dotfuscator
  • Build a Merge Module with the Obfuscated Web Service DLL AND the primary output from the Web Service MINUS the Web Service DLL through the use of a filter (I do this to extract the correct "Detected Dependencies")
  • Build the setup with primary input from the Merge Module, and content from the Web Service

Before we even attempted obfuscation our setup build "failed" every time, but the MSI was built correctly and there were no errors or warnings to note. Now I get failures on the building of the Merge Module and on the setup, and still I get no errors or warnings. The MSI still installs everything correctly, as far as I can tell using .NET reflector.

I really don't suspect it, but maybe there is something wrong with the build process?

Any help would be greatly appreciated.. I've spent much more time on this than I care to admit.