Recently we tryed to update the project to VS 2005 and run it under ASP.NET
2.0, but now we get a compile time exception:
"The value of the property 'type' cannot be parsed. The error is: Could not
load file or assembly 'TheWebService' or one of its dependencies. The system
cannot find the file specified."
The registration of the SoapExtension in the web.config is like this where
TheWebService is the name of the web service application and
SecurityExtension is the SoapExtension class in the TheWebService namesapce:
<soapExtensionTypes>
<add type="TheWebService.SecurityExtension, TheWebService" priority="1"
group="high"/>
</soapExtensionTypes>
The code has not changed and I'm guessing that this is due to changes in the
way that ASP.NET handles it's compilation.
Is it no longer possible to register a SoapExtension that is in the current
assembly for a web service? I *really* don't want to move the extension out
to another assembly.
Hoping someone out there can provide a hint on this.
Cheers,
Symon.
Hi Simon,
have you tried to specify the type only by its class name. For example:
<add type="TheWebService.SecurityExtension" priority="1" group="high"/>
Please let us know.
Martin
If the assembly is strong named, specifying the assembly version,
strong name key and culture info is advisable, for example:
<add type="TheWebService.SecurityExtension, TheWebService,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
priority="1" group="high"/>
Also, its possible to configure the assembly loader (fusion) to log
additional information to disk about binding failures via registry
settings:
http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx
This tool can also be used to log all successful binding attempts, so
you can see the exact assembly versions + locations that are loaded.
HTH.
Cheers,
Matt
Unfortunately if you don't specify the assembly name it assumes that the
extension will be coming from System.Web.Services and throws the error:
The value of the property 'type' cannot be parsed. The error is: Could not
load type
'Papa.Framework.Webservice.SoapExtensions.UnhandledExceptionExtension' from
assembly 'System.Web.Services, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.
So that doesn't work.
Symon.
My assembly is not signed, so that could be a problem. I'll try signing it
and adding the extra info as you have suggested, but this is still an issue
as the original Framework 1.1 version wasn't signed and didn't need the
additional information.
I'll keep you posted.
Symon.
For those who want to know what the problem was and how to fix it...here goes:
In ASP.NET 1.1 all code was compiled into a single assembly, the name of
which could be specified in the project properties. Normally one would
define a SoapExtension type in the web.config using <add
type="Namespace.SoapExtensionClass, AssemblyName" priority="1"
> group="0"/>
In ASP.NET 2.0 code for individual pages are compiled into their own
assemblies and all the code in the App_Code folder is compiled into the
App_Code.dll assembly. Because of this the definition of the SoapExtesion
type in the web.config needs to be <add type="Namespace.SoapExtensionClass,
App_Code" priority="1"
> group="0"/> because, in my case, the App_Code folder contains the code file which defines the SoapExtension class.
This is a fairly minor change, but it took weeks to establish the cause of
this problem. Hopefully this will be googled and can provide help to someone
else in the future!
Cheers,
Symon.
This behavior looks a little hinky to me - maybe it needs examining further.
Symon.
Symon,
Thanks for the update.
Martin
Thanks for your posting,
The value of the property 'type' cannot be parsed. The error is: Could not
load file or assembly 'App_Code' or one of its dependencies. The system
cannot find the file specified. I Get this error still can thoughts on this
Thanks
Rags
Thanks
Rags