やじゅ@アプリケーション・ラボ わんくま支局

目次

Blog 利用状況

ニュース

プロフィール

MSMVP

VSTOで、Outlook COMアドインのセットアップ

VSTOを使ったOutlook2003のアドインを開発したのですが、
http://blogs.wankuma.com/yaju/archive/2008/11/10/160848.aspx

今頃になって導入準備となり、下記のエラーに嵌まってしまいました。
Debug上では動作するのですが、インストーラでアドインを入れた場合、詳細オプション→COMアドイン→使用できるアドインでチェック付けると、下記のエラーが出て動作してくれません。
「読み込まれていません、COM アドインの読み込み中にランタイムエラーが発生しました。」


この原因が分からなく、このエラー情報をネットで検索しても大した情報も得られず、配布するアセンブリが悪いのではないか、レジストリの内容が間違っていないか、プログラムは悪いのかと起動時にMsgBox("Hello World")だけ出るもので試してみたりとか
下記サイトを、印刷してじっくり読み込んだりとか(原因が分かった後、読むと納得)
Visual Studio 2005 Tools for Office での Outlook アドイン サポートのアーキテクチャ
http://msdn.microsoft.com/ja-jp/library/aa537182(office.11).aspx

なんせ、Debug上では動作してしまうため、いろいろ手をつくすも、解決できなくて・・・


せめて、このエラーの詳しい情報が得られないだろうかと、VSTO関連のサイトで見直して下記サイトのある一文をやっと見つけました(^-^)
アプリケーション レベルのプロジェクトのデバッグ
http://msdn.microsoft.com/ja-jp/library/ms269003(VS.80).aspx
「エラーが発生するたびにメッセージ ボックスに表示するには、
VSTO_SUPPRESSDISPLAYALERTS 変数を 0 に設定します。」

環境変数にVSTO_SUPPRESSDISPLAYALERTSを追加し値を0にセット後、Outlookを起動すると、例外エラーがメッセージボックスで表示されました。
「System.IO.FileLoadException: ファイルまたはアセンブリ 'xxxxAddin'、
またはその依存関係の 1 つが読み込めませんでした。
実行するためのアクセス許可を与えることができませんでした。
ファイル名 'xxxxAddin' です。
System.Security.Policy.PolicyException: 実行するためのアクセス許可を取得できません。」

原因は、CAS(コード アクセス セキュリティ ポリシー) だったんです。
原因が分かれば、対処は可能ですね。

セキュリティポリシーの設定
コントロールパネル-管理ツール-Microsoft .NET Framework 2.0 Configration
ランタイムセキュリティポリシー→ユーザー→コードグループ→VSTOProject→(既定の会社名)を追加
メンバーシップ条件 URL C:\Program Files\(既定の会社名)\*
アクセス許可 FullTrust
 
Debug上で動作していたのは、セキュリティポリシーの設定がVS側で自動的に作成されていたからです。SetUp.exeでインストールした場合、セキュリティポリシーの設定はツール Caspol.exe
を使って別途セットしないとね。

コード アクセス セキュリティ ポリシー ツール (Caspol.exe)
http://msdn.microsoft.com/ja-jp/library/cb6t8dtz(VS.80).aspx
インストール時にインストール先のフォルダパスをレジストリに書き込む
http://dobon.net/vb/dotnet/deployment/writeinstdirinreg.html

おかげで、やろうとした仕事がほとんど進まなかった、とほほ(T^T)

投稿日時 : 2009年6月8日 1:53

コメントを追加

# caspol.exeを使用したセキュリティポリシーの設定 2009/06/29 12:45 やじゅ@アプリケーション・ラボ わんくま支局

caspol.exeを使用したセキュリティポリシーの設定

# barilup https://baricitinibrx.com
where to buy baricitinib
2021/12/12 16:23 Buksdldj

barilup https://baricitinibrx.com
where to buy baricitinib

# buy careprost in the usa free shipping https://bimatoprostrx.com
careprost bimatoprost for sale
2021/12/13 16:03 Hksfnjkh

buy careprost in the usa free shipping https://bimatoprostrx.com
careprost bimatoprost for sale

# buy clomid https://clomidt.com
clomid pills 2022/01/03 19:15 Clomid

buy clomid https://clomidt.com
clomid pills

# Hi, all is going well here and ofcourse every one is sharing facts, that's in fact excellent, keep up writing. 2022/01/31 22:20 Hi, all is going well here and ofcourse every one

Hi, all is going well here and ofcourse every one is sharing facts, that's in fact excellent, keep up writing.

# doxycycline hyc https://doxycyline1st.com/
cheap doxycycline online 2022/02/26 0:46 Jusidkid

doxycycline hyc https://doxycyline1st.com/
cheap doxycycline online

# purchase doxycycline online https://doxycyline1st.com/
doxycycline order online 2022/02/26 8:22 Jusidkid

purchase doxycycline online https://doxycyline1st.com/
doxycycline order online

# price of doxycycline https://doxycyline1st.com/
doxycycline generic 2022/02/26 8:27 Doxycycline

price of doxycycline https://doxycyline1st.com/
doxycycline generic

# doxycycline without prescription https://doxycyline1st.com/
buy doxycycline for dogs 2022/02/26 9:49 Jusidkid

doxycycline without prescription https://doxycyline1st.com/
buy doxycycline for dogs

# doxycycline 100mg capsules https://doxycyline1st.com/
doxycycline hydrochloride 100mg 2022/02/26 17:49 Jusidkid

doxycycline 100mg capsules https://doxycyline1st.com/
doxycycline hydrochloride 100mg

# order doxycycline https://doxycyline1st.com/
doxycycline hydrochloride 100mg 2022/02/26 20:07 Doxycycline

order doxycycline https://doxycyline1st.com/
doxycycline hydrochloride 100mg

# clomid uk http://clomidus.store/ 2022/04/12 13:04 Clomids

clomid uk http://clomidus.store/

# order clomid online https://clomiden.fun/ 2022/04/12 20:26 Clomids

order clomid online https://clomiden.fun/

# prednisone 10mg canada https://prednisoneus.shop/ 2022/04/16 22:59 Prednisone

prednisone 10mg canada https://prednisoneus.shop/

# prednisone canada prices http://prednisoneen.store/ 2022/04/17 6:47 Prednisone

prednisone canada prices http://prednisoneen.store/

# QBNXiqMRvgkNrsB 2022/04/19 10:38 johnanz

http://imrdsoacha.gov.co/silvitra-120mg-qrms

# When some one searches for his vital thing, thus he/she desires to be available that in detail, therefore that thing is maintained over here. https://holdahl.no/User:GerardoWeber8 https://vanburg.com/mw19/index.php/Mortgage_Broker_Secrets_That_No_One_E 2022/05/19 23:22 When some one searches for his vital thing, thus

When some one searches for his vital thing, thus he/she desires to be available that in detail, therefore
that thing is maintained over here.

https://holdahl.no/User:GerardoWeber8
https://vanburg.com/mw19/index.php/Mortgage_Broker_Secrets_That_No_One_Else_Knows_About
https://axon.cs.byu.edu/wiki/index.php/The_Business_Of_Mortgage_Broker
https://wikiblaze.com/wiki/A_3rd_Option_Is_A_Mortgage_Broker
http://69.63.144.172/index.php?title=Be_Taught_Something_New_From_Mortgage_Lenders_In_San_Jose_Ca_Lately_We_Requested_You_Answered
http://www.kshpedia.com/avenue_speak:mo_tgage_b_oke

# generic lasix https://buylasix.icu/
lasix generic name 2022/06/24 17:16 LasixRx

generic lasix https://buylasix.icu/
lasix generic name

# furosemida 40 mg https://buylasix.icu/
lasix uses 2022/06/25 1:05 LasixRx

furosemida 40 mg https://buylasix.icu/
lasix uses

# clomid buy https://clomidonline.icu/ 2022/07/08 13:45 Clomidj

clomid buy https://clomidonline.icu/

# clomid for sale https://clomidonline.icu/ 2022/07/12 23:51 Clomidj

clomid for sale https://clomidonline.icu/

# Amaryl https://allpharm.store/ 2022/07/21 22:12 AllPharm

Amaryl https://allpharm.store/

# meds online https://allpharm.store/ 2022/07/22 5:59 AllPharm

meds online https://allpharm.store/

# ivermectin for goat lice https://stromectolbestprice.com/ 2022/07/30 0:39 BestPrice

ivermectin for goat lice https://stromectolbestprice.com/

# ivermectin dispersible tablets https://stromectolbestprice.com/ 2022/07/30 8:19 BestPrice

ivermectin dispersible tablets https://stromectolbestprice.com/

# prednisone buy https://deltasone.icu/
prednisone in canada 2022/08/22 17:35 Prednisone

prednisone buy https://deltasone.icu/
prednisone in canada

# best metformin brand in india https://glucophage.top/
canadian metformin price 2022/08/23 15:34 Niujsdkj

best metformin brand in india https://glucophage.top/
canadian metformin price

# ed pills https://ed-pills.xyz/
new treatments for ed 2022/09/15 19:19 EdPills

ed pills https://ed-pills.xyz/
new treatments for ed

# treatment for ed https://ed-pills.xyz/
ed pills otc 2022/09/16 2:34 EdPills

treatment for ed https://ed-pills.xyz/
ed pills otc

# generic ed pills https://ed-pills.xyz/
medications for ed 2022/09/16 14:50 EdPills

generic ed pills https://ed-pills.xyz/
medications for ed

# best ed pills non prescription https://ed-pills.xyz/
erectile dysfunction medications 2022/09/16 19:45 EdPills

best ed pills non prescription https://ed-pills.xyz/
erectile dysfunction medications

# pills erectile dysfunction https://ed-pills.xyz/
best ed medications 2022/09/17 2:55 EdPills

pills erectile dysfunction https://ed-pills.xyz/
best ed medications

# compare prednisone prices https://prednisone20mg.icu/ 2022/10/15 13:23 Prednisone

compare prednisone prices https://prednisone20mg.icu/

#  https://clomidforsale.site/ 2022/11/13 21:19 ForSale

https://clomidforsale.site/

# plenty of fish login https://topdatingsites.fun/
free dating and chatting 2022/11/15 0:29 DatingTop

plenty of fish login https://topdatingsites.fun/
free dating and chatting

# prednisone prices https://prednisone20mg.site/
where to buy prednisone in canada 2022/11/15 17:59 Prednisone

prednisone prices https://prednisone20mg.site/
where to buy prednisone in canada

# prednisone 5mg capsules https://prednisonepills.site/
prednisone for dogs 2022/11/28 23:54 Prednisone

prednisone 5mg capsules https://prednisonepills.site/
prednisone for dogs

# where to buy prednisone 20mg https://prednisonepills.site/
average cost of prednisone 20 mg 2022/11/30 7:54 Prednisone

where to buy prednisone 20mg https://prednisonepills.site/
average cost of prednisone 20 mg

# medication for ed https://edpills.science/
otc ed pills 2023/01/07 14:00 Edpills

medication for ed https://edpills.science/
otc ed pills

# Best and news about drug. Comprehensive side effect and adverse reaction information.
https://edonlinefast.com
Comprehensive side effect and adverse reaction information. Read information now. 2023/02/17 7:19 EdOnline

Best and news about drug. Comprehensive side effect and adverse reaction information.
https://edonlinefast.com
Comprehensive side effect and adverse reaction information. Read information now.

# no prescription online prednisone - https://prednisonesale.pro/# 2023/04/22 10:31 Prednisone

no prescription online prednisone - https://prednisonesale.pro/#

# best canadian mail order pharmacies https://pillswithoutprescription.pro/# 2023/05/14 22:14 PillsPresc

best canadian mail order pharmacies https://pillswithoutprescription.pro/#

# top mexican pharmacies https://pillswithoutprescription.pro/# 2023/05/15 5:17 PillsPresc

top mexican pharmacies https://pillswithoutprescription.pro/#

# best ed drug: https://edpills.pro/# 2023/05/15 22:15 EdPillsPro

best ed drug: https://edpills.pro/#

# erection pills that work https://edpill.pro/# - pills for ed 2023/06/27 10:19 EdPills

erection pills that work https://edpill.pro/# - pills for ed

# best ed treatment https://edpill.pro/# - best ed treatment pills 2023/06/27 16:02 EdPills

best ed treatment https://edpill.pro/# - best ed treatment pills

# canadian drug store legit https://fastpills.pro/# best online canadian pharcharmy 2023/06/29 17:45 FastPills

canadian drug store legit https://fastpills.pro/# best online canadian pharcharmy

# paxlovid price https://paxlovid.pro/# - paxlovid cost without insurance 2023/07/02 23:12 Paxlovid

paxlovid price https://paxlovid.pro/# - paxlovid cost without insurance

# paxlovid buy https://paxlovid.life/# buy paxlovid online 2023/07/26 1:57 Paxlovid

paxlovid buy https://paxlovid.life/# buy paxlovid online

# cheap erectile dysfunction pills online https://edpills.ink/# - erection pills online 2023/07/27 2:26 EdPills

cheap erectile dysfunction pills online https://edpills.ink/# - erection pills online

# paxlovid price https://paxlovid.bid/ paxlovid covid 2023/10/25 18:29 Paxlovid

paxlovid price https://paxlovid.bid/ paxlovid covid

# 3000mg prednisone https://prednisonepharm.store/ 20 mg prednisone tablet 2024/01/20 13:16 Prednisone

3000mg prednisone https://prednisonepharm.store/ 20 mg prednisone tablet

# ed medication https://edpill.cheap/ best ed treatment pills 2024/02/09 20:11 EdPills

ed medication https://edpill.cheap/ best ed treatment pills

# lana rhoades - https://lanarhoades.fun/ lana rhoades izle
2024/03/02 21:21 LanaRho

lana rhoades - https://lanarhoades.fun/ lana rhoades izle

# lana rhodes - https://lanarhoades.fun/ lana rhoades modeli
2024/03/02 21:24 Rhodess

lana rhodes - https://lanarhoades.fun/ lana rhoades modeli

# aviator bet https://aviatormocambique.site como jogar aviator
2024/03/11 20:54 AviatorMaz

aviator bet https://aviatormocambique.site como jogar aviator

# aviator game online: https://aviatorghana.pro/ aviator game
2024/03/12 6:42 AviatorGh

aviator game online: https://aviatorghana.pro/ aviator game

タイトル
名前
URL
コメント