Atlanta .NET Regular Guys

News

Brendon Schwartz - Email Me
Matt Ranlett - Email Me

Brendon Schwartz

MVP Logo
Community Kit for SharePoint
View Brendon Schwartz's profile on LinkedIn

Matt Ranlett

Matt Ranlett MVP Logo

Community Links

Useful Links

SharePoint 2007

ASP.NET 2.0

Atlanta Area Bloggers

BizTalk

SharePoint 2007 WebControls

SharePoint 2007 Development

Error Type Not loading when building custom web services in SharePoint 2007

If you have followed the steps in the MSDN article http://msdn2.microsoft.com/en-us/library/ms464040.aspx or used the blog post http://blogs.ittoolbox.com/km/sharepoint/archives/creating-a-custom-web-service-for-sharepoint-13553 you may have run into an error that looked like the follow:

Could not load type 'DevCow.SharePoint.WebServices.HelloBrendon' from assembly 'DevCow.SharePoint.WebServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bf7fa58d7195484e'

Error Message

You might find it strange that nothing is in the eventlog or the SharePoint log, so for a new person or even skilled person this would give them no idea of what to change.

There could be a couple of reasons.

  1. The class might not be in the assembly.  To fix this just add the right reference to the class.
  2. I couldn't find the real problem, sorry there is no magic fix yet.

Here is what I did to fix number 2

  1. I added this the AssemblyInfo.cs file

    using System.Security;

    [assembly: AllowPartiallyTrustedCallers()]
  2. Rebuilt the Class file.
  3. Ran IISReset.
  4. Redeployed my files to the server.
  5. Navigated to the file http://sharepoint.devcow.com/_layouts/DevCowSampleWebService.asmx
  6. Removed the added code from AssemblyInfo.cs
  7. Rebuilt the Class file
  8. Ran IISReset.
  9. Redeployed my files to the server
  10. Navigated to the file http://sharepoint.devcow.com/_layouts/DevCowSampleWebService.asmx and it still worked.

I am sorry that I don't have more helpful information for this problem, I know it can be frustrating if you do have the error.

Now I am having trouble recreating the problem, but I know I saw it.  If you are having trouble please email me to try to figure this problem out.

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)