Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem converting webservice from VS 2003 to VS 2005

0 views
Skip to first unread message

Symon

unread,
Mar 15, 2006, 11:31:23 AM3/15/06
to
I've got a web service project that was built under VS 2003 which has a
SoapExtension in the project. The SoapExtension is registered in the
<soapExtensionTypes> element of the web.config and has worked fine for some
time.

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.

Martin Kulov

unread,
Mar 15, 2006, 8:39:27 PM3/15/06
to
"Symon" <Sy...@discussions.microsoft.com> wrote in message
news:799D479C-02F4-4DFE...@microsoft.com...

> I've got a web service project that was built under VS 2003 which has a
> SoapExtension in the project. The SoapExtension is registered in the
> <soapExtensionTypes> element of the web.config and has worked fine for
> some
> time.
>
> 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."
>

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

Matt Dunn

unread,
Mar 19, 2006, 1:14:56 AM3/19/06
to
Hi Symon,

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

Symon

unread,
Mar 23, 2006, 5:53:42 AM3/23/06
to
Thanks Martin,

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.

Symon

unread,
Mar 23, 2006, 5:59:03 AM3/23/06
to
Hi Matt,

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.

Symon

unread,
Mar 23, 2006, 6:24:29 AM3/23/06
to
Ok, problem solved. I stumbled upon the answer when I tried publishing the
web service and could finally see all the DLLs that were generated.

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.

Symon

unread,
Mar 23, 2006, 7:26:34 AM3/23/06
to
Talking to myself now, but it turns out that for my solution to work I *must*
publish the website *before* I add the soapExtensionType directive to the
web.config. I'm not sure why this is, since I can delete the published files
and still rebuild...there must be some cached copy of the App_Code.dll
somewhere that ASP.NET is using.

This behavior looks a little hinky to me - maybe it needs examining further.

Symon.

Martin Kulov

unread,
Mar 23, 2006, 11:51:55 AM3/23/06
to
"Symon" <Sy...@discussions.microsoft.com> wrote in message
news:9375D9BD-588A-4198...@microsoft.com...

> Talking to myself now, but it turns out that for my solution to work I
> *must*
> publish the website *before* I add the soapExtensionType directive to the
> web.config. I'm not sure why this is, since I can delete the published
> files
> and still rebuild...there must be some cached copy of the App_Code.dll
> somewhere that ASP.NET is using.

Symon,

Thanks for the update.

Martin


Rags

unread,
Oct 9, 2006, 11:09:02 AM10/9/06
to
Hi Symon,

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

Rags

unread,
Oct 9, 2006, 11:31:02 AM10/9/06
to
More Information about the problem
This works fine when i add a Soap Extension in the Web Service. But i get
this error when add the extension in the ASP.NET 2.0 Web.config file

Thanks
Rags

toargul

unread,
Jan 18, 2007, 2:50:01 PM1/18/07
to
Thanks Guys. I was getting similar problem. And i resolved it. Only problem i
am getting is now that it is not logging into the file, which i have
specified, in the SoapExtension Class. ?
Did some one have similar problems ?
thanks in advance
Tore
0 new messages