環境
煩わしい Excel アドインのコンパイル バグが存在します。現在これを回避できる唯一の方法は、VSTO MSBuild .targets ファイルを編集することです。
- C:\Program Files\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets
以下の変更により、Excel アドインをコンパイルできますが、カスタム リボンが表示されなくなるという副作用があります。
VSTO のバグと回避策については、こちらで詳しく説明しています: "FindRibbons" タスクが予期せず失敗しました
空のリボン タイプの望ましくない副作用を伴う .targets の変更
<!-- This part is causing the compilation to fail and has to be commented out -->
<!-- <FindRibbons-->
<!-- AssemblyName="$(AbsolutePathToCustomization)"-->
<!-- TargetFramework="$(TargetFrameworkVersion)"-->
<!-- >-->
<!-- <Output TaskParameter="RibbonTypes" ItemName="RibbonTypesCollection"/>-->
<!-- </FindRibbons>-->
<!-- Now RibbonTypes is empty, causing the side-effect-->
<!-- Used to be RibbonTypes="@(RibbonTypesCollection)"-->
<!-- Can I manually recreate @(RibbonTypesCollection)?-->
<GenerateOfficeDocumentManifest Condition="'$(VSTO_ProjectType)' == 'Document'"
SolutionID="$(SolutionID)"
RibbonTypes=""
TargetFramework="$(TargetFrameworkVersion)"
>
パラメータを手動で入力しますか?
今、私は次のようなものを提供する必要があります
"ProjectNamespace.RibbonName、AssemblyName、バージョン = 1.0.0.0、カルチャ = ニュートラル、PublicKeyToken = null"
- しかし、データがどのような形式でなければならないのか正確にはわかりませんし、MSBuild の構文もわかりませんか?
- RibbonTypes 属性を手動で入力するにはどうすればよいでしょうか?