我在这里发布了一篇文章 ( How do I set permissions on my VSTO outlook add-in? ) 并且我能够构建我的安装程序。我认为一旦安装程序自行构建,一切都会正常工作。
我错了。它适用于我运行安装程序的大约一半的 PC。我的问题是另一半不起作用。我正在尝试为 Outlook Office 2003 安装加载项。
我什至使用批处理文件手动创建步骤。在这些 PC 上似乎没有任何工作,我找不到可以排除或使 VSTO Addin 工作的公分母。
这是我正在使用的批处理文件。我在做什么/没有做错什么?
我真的可以使用 VSTO 专家的帮助。谢谢!!!!
编辑 我已更改批处理文件和注册表设置以反射(reflect)对它们的最新更新。我还附上了来自无法工作的 PC 的错误文本。
@echo off
echo Installing Visual Studio for Office Runtime (SE 2005)...
..\VSTO\vstor.exe
echo Creating Directories...
mkdir "c:\program files\Project Archiver"
echo Installying Add-In...
echo Copying files...
xcopy /Y *.dll "c:\program files\Project Archiver"
xcopy /Y *.manifest "c:\program files\Project Archiver"
echo Setting Security...
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol.exe" -polchgprompt off
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol.exe" -u -ag All_Code -url "c:\program files\Project Archiver\ProjectArchiver.dll" FullTrust -n "Project Archiver" -d "Outlook plugin for archiving"
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol.exe" -u -ag All_Code -url "c:\program files\Project Archiver\Microsoft.Office.Interop.SmartTags.dll" FullTrust -n "Project Archiver" -d "Outlook plugin for archiving"
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol.exe" -polchgprompt on
echo Loading Registry Values...
"c:\program files\Project Archiver\VSTO_settings.reg"
echo "That should do it."
pause
我直接从该应用程序运行的 PC 上获取了注册表设置(在上面的批处理文件中提到过)。我使用的 VSTO 注册表设置是:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ProjectArchiver\CLSID]
@="{27830B8D-F7A1-4945-AC4A-47661B9ED36D}"
[HKEY_CLASSES_ROOT\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}]
@="ProjectArchiver -- an addin created with VSTO technology"
[HKEY_CLASSES_ROOT\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}\InprocServer32]
@=hex(2):25,00,43,00,6f,00,6d,00,6d,00,6f,00,6e,00,50,00,72,00,6f,00,67,00,72,\
00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,4d,00,69,00,63,00,\
72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,53,00,68,00,61,00,72,00,65,00,64,\
00,5c,00,56,00,53,00,54,00,4f,00,5c,00,38,00,2e,00,30,00,5c,00,41,00,64,00,\
64,00,69,00,6e,00,4c,00,6f,00,61,00,64,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
00,00,00
"ManifestName"="ProjectArchiver.dll.manifest"
"ThreadingModel"="Both"
"ManifestLocation"="C:\\Program Files\\Project Archiver\\"
[HKEY_CLASSES_ROOT\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}\ProgID]
@="ProjectArchiver"
[HKEY_CLASSES_ROOT\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}\Programmable]
[HKEY_CLASSES_ROOT\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}\VersionIndependentProgID]
@="ProjectArchiver"
[HKEY_CLASSES_ROOT\ProjectArchiver]
@=""
[HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}]
@="ProjectArchiver -- an addin created with VSTO technology"
[HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}\InprocServer32]
@=hex(2):25,00,43,00,6f,00,6d,00,6d,00,6f,00,6e,00,50,00,72,00,6f,00,67,00,72,\
00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,4d,00,69,00,63,00,\
72,00,6f,00,73,00,6f,00,66,00,74,00,20,00,53,00,68,00,61,00,72,00,65,00,64,\
00,5c,00,56,00,53,00,54,00,4f,00,5c,00,38,00,2e,00,30,00,5c,00,41,00,64,00,\
64,00,69,00,6e,00,4c,00,6f,00,61,00,64,00,65,00,72,00,2e,00,64,00,6c,00,6c,\
00,00,00
"ManifestName"="ProjectArchiver.dll.manifest"
"ThreadingModel"="Both"
"ManifestLocation"="C:\\Program Files\\Project Archiver\\"
[HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}\ProgID]
@="ProjectArchiver"
[HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}\Programmable]
[HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{27830B8D-F7A1-4945-AC4A-47661B9ED36D}\VersionIndependentProgID]
@="ProjectArchiver"
[HKEY_LOCAL_MACHINE\Software\Classes\ProjectArchiver]
@=""
[HKEY_LOCAL_MACHINE\Software\Classes\ProjectArchiver\CLSID]
@="{27830B8D-F7A1-4945-AC4A-47661B9ED36D}"
[HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\Addins\ProjectArchiver]
"Manifest"="C:\\Program Files\\Project Archiver\\ProjectArchiver.dll.manifest"
"LoadBehavior"=dword:00000003
"FriendlyName"="ProjectArchiver"
"Description"="ProjectArchiver -- an addin created with VSTO technology"
"CommandLineSafe"=dword:00000001
我得到的错误是:
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Outlook, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Office.Interop.Outlook, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
at ProjectArchiver.ThisAddIn.Initialize()
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.CreateStartupObject(EntryPoint entryPoint, Dependency dependency, Assembly objectAssembly)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ConfigureAppDomain()
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadAssembliesAndConfigureAppDomain(IHostServiceProvider serviceProvider)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadEntryPointsHelper(IHostServiceProvider serviceProvider)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Applications.Runtime
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.816
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
----------------------------------------
Microsoft.Office.Tools.Common
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.816
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Office.Tools.Common/8.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
ProjectArchiver
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Callidus/Project%20Archiver/ProjectArchiver.DLL
----------------------------------------
最佳答案
好的,显然插件会被 Outlook 自动禁用。另一个略有不同的答案:
转到开始 -> 控制面板 -> 系统 -> 高级 -> 环境
变量 -> 系统变量,并添加值为 0 的 VSTO_SUPPRESSDISPLAYALERTS。这将在屏幕上显示错误消息,而不是静默禁用 VSTO。如果您希望将日志记录到磁盘,请添加 VSTO_LOGALERTS 并将其设置为 1。
希望这将为您提供一些额外的细节,可以帮助我们解决您的问题!
关于outlook - VSTO:安装 Outlook Office 2003 加载项,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1144492/