开发者

web service could not create type error with type in the GAC

Stuck with an unusual problem, would seem that I love doing things that's not very common.

I have a composite control, that checks to see if a given web service file exists in the root of my application, if it does not, it creates the file with the necessary directive in the markup to ball rolling, something like:

<%@ WebService Language="C#" Class="Company.Project.Assembly.ClassName" %>

which in turn, gets saved to the output. Once this step has been completed, a recycle on application pool is initiated to get the new page rendered within IIS.

My assembly that the directive points to, is GAC deployed, but for some arb reason is being ignored when the ASMX is served through IIS. If I copy the assembly into the BIN directory for the application is works fine, however, I would like to deploy this solution as a web part update within my SharePoint farm and having FULL trust enabled in my application is not a route I would like to go.

Is is correct in my assumption that ASMX files or any file that inherits from a class within a GAC dep开发者_开发知识库loyed assembly is ignored? I don't see why this would be, as far as I'm aware, will IIS try an map the assembly in the BIN, if it could not be found will it go and interrogate the GAC to see if it can find it in there, correct?


When you reference a web service assembly in the GAC, you need to use the full class name with assembly like this:

<%@ WebService Language="C#" Class="Company.Project.Assembly.ClassName, Company.Project.Assembly, version=1.0.0.0, Culture=neutral, PublicKeyToken=0000000000000000" %>

We also deploy web services to SharePoint, and this works perfectly for us.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜