我们有一个控制台应用程序,用于管理WSS 3.0站点。 该应用程序使用Microsoft.SharePoint程序集,该程序集在WSS 3.0中的版本为12.0.0.0
现在,我们希望在SharePoint 2013上使用相同的控制台应用程序,而无需为该特定版本重建新的应用程序。 由于SharePoint 2013附带了Microsoft.SharePoint程序集的15.0.0.0版,因此我创建了一个包含以下内容的应用程序配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.SharePoint"
publicKeyToken="71e9bce111e9429c"
culture="neutral"
/>
<!-- Redirecting to version 15.0.0.0 of the assembly. -->
<bindingRedirect oldVersion="12.0.0.0"
newVersion="15.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
它不起作用,但绑定失败。有什么想法吗?
我在绑定日志中看到以下内容:
** Assembly Binder Log Entry (2013-07-15 @ 11:28:53) **
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable C:\Users\fredrikg\Desktop\Customer\Bin\UseMicrosoftSharePoint.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = INFOWEAVER\fredrikg
LOG: DisplayName = Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
(Fully-specified)
LOG: Appbase = file:///C:/Users/fredrikg/Desktop/Customer/Bin/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : UseMicrosoftSharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\fredrikg\Desktop\Customer\Bin\UseMicrosoftSharePoint.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Redirect found in application configuration file: 12.0.0.0 redirected to 15.0.0.0.
LOG: Post-policy reference: Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/fredrikg/Desktop/Customer/Bin/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/Users/fredrikg/Desktop/Customer/Bin/Microsoft.SharePoint/Microsoft.SharePoint.DLL.
LOG: Attempting download of new URL file:///C:/Users/fredrikg/Desktop/Customer/Bin/Microsoft.SharePoint.EXE.
LOG: Attempting download of new URL file:///C:/Users/fredrikg/Desktop/Customer/Bin/Microsoft.SharePoint/Microsoft.SharePoint.EXE.
LOG: All probing URLs attempted and failed.
LOG: Attempting to install assembly using Windows Installer.
LOG: GAC Lookup was unsuccessful.