Question

I have written a bridge between my application and the Sharepoint webservices, to return the data to my project in a useful format. However When any line tries to create a new instance of this webServiceBridge class, it throws this exception.

Could not load type 'SharepointWeb.ShareList' from assembly 'SharepointWeb, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null'.

I'm not referencing or using the Sharepoint.dll libraries at the moment as this application is going to be external from Sharepoint Server. For compatibility with WSS3 the sharepoint plugin project (the application I'm writing) is .NET 3.5 but the "configuration tool project" is .NET 4.

All my webFunctions code does is take the XmlNodes returned from the web services and sort it into something usable. In most cases they return List<MyObject>

These are the only web methods I am using.

permissionService.GetPermissionCollection listService.GetList listService.GetListItems listService.GetListCollection siteDataService.GetWeb

I have tried adding Microsoft.Sharepoint.dll as a reference to the project but this did not resolve the issue. But even if it had, I don't understand why it is needed.

Here is what Fuslogvw had to say: (How ever I will point out that this error appears in FuslogVw before the exception causing method is called on and tries to use the web service. Apart from this error it is empty!)

* Assembly Binder Log Entry (19/07/2012 @ 14:38:45) *

The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Working\XXXX\Configuration Tool\v2.6.0.3\ConfigurationTool\ConfigurationTool\bin\Debug

\ConfigurationTool.vshost.exe --- A detailed error log follows.

=== Pre-bind state information === LOG: User = YYYY\XXXX LOG: DisplayName = msvcm80, Version=8.0.50727.6195, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (Fully-specified) LOG: Appbase = file:///C:/Working/XXXX/Configuration Tool/v2.6.0.3/ConfigurationTool/ConfigurationTool/bin/Debug/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = ConfigurationTool.vshost.exe Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Working\XXXX\Configuration Tool\v2.6.0.3\ConfigurationTool\ConfigurationTool\bin\Debug

\ConfigurationTool.vshost.exe.Config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: msvcm80, Version=8.0.50727.6195, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///C:/Working/XXXX/Configuration

Tool/v2.6.0.3/ConfigurationTool/ConfigurationTool/bin/Debug/msvcm80.DLL. LOG: Attempting download of new URL file:///C:/Working/XXXX/Configuration

Tool/v2.6.0.3/ConfigurationTool/ConfigurationTool/bin/Debug/msvcm80/msvcm80.DLL. LOG: Attempting download of new URL file:///C:/Working/XXXX/Configuration

Tool/v2.6.0.3/ConfigurationTool/ConfigurationTool/bin/Debug/msvcm80.EXE. LOG: Attempting download of new URL file:///C:/Working/XXXX/Configuration

Tool/v2.6.0.3/ConfigurationTool/ConfigurationTool/bin/Debug/msvcm80/msvcm80.EXE. LOG: All probing URLs attempted and failed.

edit: Added Msvcm80.dll from %Program Files%\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT

No errors in FuslogVW but exception persists.

This is the full Exception text, not much to go on!

System.TypeLoadException was caught Message=Could not load type 'SharepointWeb.ShareList' from assembly 'SharepointWeb, Version=2.6.0.0, Culture=neutral, PublicKeyToken=null'.
Source=Sharepoint TypeName=SharepointWeb.ShareList StackTrace: at Sharepoint.FolderBrowser.GrowTree(String siteUrl) at Sharepoint.FolderBrowser..ctor(String siteURL) InnerException:

Is there anywhere else I can look to find more information that may help me diagnose the cause of this issue?

Était-ce utile?

La solution 2

The project which references the web services needs to be signed with a strong name key. Then placed in the Sharepoint servers GAC or Sharepoint web's /bin directory.

Mine did not have a SNK.

Autres conseils

From error code

0x80070002

it looks like that you have a permission issue. Try to run your app as administrator. Also check that account belongs to SP related user groups.

I also stuck Sharepoint.DLL into my debug folder, as fuslog as mentioned searching there before

note that if assembly persists in GAC, then CLR tooks it first from there.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top