programing tip

로드되지 않는 VSTO 추가 기능의 문제를 해결하는 방법은 무엇입니까?

itbloger 2020. 10. 29. 07:53
반응형

로드되지 않는 VSTO 추가 기능의 문제를 해결하는 방법은 무엇입니까?


내 VSTO Outlook 추가 기능이 갑자기 한 고객 컴퓨터에서 작동을 멈 췄고 (로드되지 않고, 오류 메시지도 없음) 문제 해결이 멈췄습니다. 컴퓨터는 Windows 7 x86, Outlook 2007입니다. 추가 기능은 Visual Studio 2008로 작성되었으며 2003 PIA와 함께 VSTO 2005를 사용합니다 (Outlook 2003도 지원해야하므로). 다른 컴퓨터에서는 완벽하게 작동합니다.

유용한 문제 해결 출력을 얻으려고 시도한 내용은 다음과 같습니다.

아무것도. 추가 기능 만은 포기하지 않고로드되지 않습니다 어떤 이유의 표시를. 또한 "일반적인 용의자"(CAS 정책, 설치된 PIA, 레지스트리의 LoadBehavior, VSTO 및 추가 기능 재설치)도 확인했습니다.

기타 관찰 :

  • LoadBehavior레지스트리에서 3.
  • 추가 기능은 Outlook에서 "사용 안 함"으로 표시됩니다. "COM 추가 기능"에서 확인란을 선택해도 아무 작업도 수행되지 않습니다 (오류 없음, 양식을 다시 입력하면 확인란이 다시 지워짐).
  • 다른 고객 컴퓨터에서는 완벽하게 작동하며이 컴퓨터에서는 완벽하게 작동했습니다. (아니요, 고객은 자신의 컴퓨터에서 변경된 사항을 말할 수 없습니다.)
  • 나는이 Trace.WriteLine내 코드합니다 (에서 첫 번째 줄의 맨 상단에 메시지 ThisAddIn_Startup(내가 확인할 도달하지 핸들러), DebugView와 ). 따라서로드하지 않는 이유는 내 추가 기능의 예외가 아니라 VSTO가 추가 기능을로드하지 못하거나 Outlook이 VSTO를로드하지 못하기 때문입니다.

임의의 디버깅 ( "try this ...", "try that ...") 대신 Outlook 및 / 또는 VSTO가 무엇이 잘못되었는지 알려주 도록 강제 하고 싶습니다 . 즉, 대신 유용한 오류 메시지를 표시합니다. 단지의 아무것도하지 않고 추가 기능을 사용하려고 할 때. 어떤 아이디어?


추가 기능을 다시 활성화 했습니까? 비활성화 된 대기열에있는 후에는 실행되지 않습니다. 비활성화 된 추가 기능 화면에서 다시 활성화 한 후 COM-AddIn 화면의 확인란을 선택하여로드하도록 할 VSTO_SUPPRESSDISPLAYALERTS수 있습니다. 그러면 처음에 발생한 일에 대한 변수 를 설정하기 때문에 더 자세한 정보 가 표시됩니다. 장소.


다음은 RobertG5의 솔루션에 대한 자세한 내용입니다 (댓글이 너무 길어짐).

문제는 추가 기능 이 Outlook 에서 하드 비활성화 되었다는 것 입니다. 내가 배운 것처럼 이것은 "일반적인"로드되지 않는 시나리오와는 다른 것입니다. 이것을 실현의 핵심은 추가 기능이 아래에 표시하지 않았다 통지이었다 비활성 응용 프로그램 추가 기능 이 아니라 아래 장애인 응용 프로그램 추가 기능 . 차이가 있습니다. 후자의 경우 COM-AddIn 화면으로 이동하여 확인란을 선택하면 아무 작업도 수행되지 않습니다. ( "이 추가 기능이 하드 비활성화 되었기 때문에로드 할 수 없습니다."라는 멋진 메시지 상자가 너무 많이 묻는 것 같습니다 ... 한숨 .)

그렇다면 하드 비활성화 된 추가 기능을 다시 활성화하려면 어떻게해야합니까?

  1. 에서 관리 상자에서 변경 COM은 추가 기능장애 추가 기능 , 다음 이동을 클릭합니다.
  2. 추가 기능을 선택하고 사용을 클릭 합니다. 닫기를 클릭 합니다 .

이제 추가 기능을 다시로드 할 수 있습니다.

  1. 에서 관리 상자에서 변경 장애인 추가 기능을COM 추가 기능 , 다음 이동을 클릭합니다.
  2. 비활성화 된 추가 기능 옆의 확인란을 선택합니다. 클릭 OK .

참조 : http://msdn.microsoft.com/en-us/library/ms268871.aspx


이것이 오래되었다는 것을 알고 있지만 여러 가지 이유로 최근로드되지 않는 Office 추가 기능의 문제를 해결했습니다.

많은 시간을 낭비했기 때문에 공유 할 것이라고 생각 했으므로 추가 기능이로드되지 않거나 표시되지 않는 경우 이러한 솔루션을 시도해보십시오.

1). 추가 기능이로드되지 않았습니다.

로드되지 않았습니다. COM 추가 기능을로드하는 동안 런타임 오류가 발생했습니다.

여기에 이미지 설명 입력

이 문제는 .Net 프레임 워크 3.5 또는 4.0이 없기 때문입니다.

참고 : x64에서는 .Net 4.0 만 필요하지만 x86 PC에서는 .Net 4.0을 설치 한 후 오류가 발생했습니다. 기사에 이어 .Net 3.5도 설치 한 다음 x86 PC에서 작동했습니다!

2). 추가 기능이로드되지 않았습니다.

레지스트리 키를 올바르게 입력했는지 다시 확인하십시오. 가끔 Behavior를 입력하지만 미국식 철자는 Behavior이므로 "LoadBehavior"를 다시 확인합니다.

여기에 이미지 설명 입력

또한 "LoadBehavior"가 3인지 확인하십시오 . 값 목록은 http://msdn.microsoft.com/en-us/library/vstudio/bb386106.aspx#LoadBehavior를 참조하십시오 .

삼). 추가 기능이 표시되지 않습니다.

Excel> 파일> 옵션> 추가 기능으로 이동하여 추가 기능을 표시하고 관리 드롭 다운 목록을 선택하고 COM 추가 기능으로 설정 한 다음 이동을 클릭하여 추가 기능을 표시 할 수 있습니다. COM 추가 기능 대화 상자에서 추가 기능이 선택되어 있는지 확인하십시오.

4). 추가 기능이 비활성화되었습니다.

또는 추가 기능이 비활성화되어 숨겨져있을 수 있습니다. Excel> 파일> 옵션> 추가 기능으로 이동하여 추가 기능을 활성화하고 관리 드롭 다운 목록을 선택하고 사용 안 함으로 설정하고 이동을 클릭합니다. 비활성화 된 추가 기능을 선택하고 활성화를 클릭합니다.

여기에 이미지 설명 입력

5). ExcelDNA 사용자 정의 수식이 올바르게 렌더링되지 않습니다.

셀 값을 보는 대신 #NAME?

Set the following registry key:

        HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\options\OPEN:

With the correct value:

        /R "C:\Program Files\XYZ\XYZ Addin\ExcelDNA.XYZAddIn.xll"

6). Excel HANGS after showing a messagebox

Turn back on the application settings:

        xlApp.ScreenUpdating = true;
        xlApp.DisplayAlerts = true;
        xlApp.Calculation = XlCalculation.xlCalculationAutomatic;
        xlApp.UserControl = true;
        xlApp.EnableEvents = true;

7). Further troubleshooting

Enable your VSTO log file by adding the following on your system environment variables:

NAME: VSTO_LOGALERTS
VALUE: 1

There might be an exception error that is why your add-in is not loading.

You can check this source for more info on VSTO logging and alerts, but in essence you change two environment variable values depending on what you need to do:

Displaying VSTO Alert Prompts

To display each error in a message box, set the VSTO_SUPPRESSDISPLAYALERTS variable to 0 (zero). You can suppress the messages by setting the variable to 1 (one).

Logging VSTO Alerts to a Log file

To write the errors to a log file, set the VSTO_LOGALERTS variable to 1 (one).

Visual Studio Tools for Office creates the log file in the folder that contains the application manifest. The default name is .manifest.log. To stop logging errors, set the variable to 0 (zero).


I would suggest using a Microsoft tool to diagnose add-in issues called AddinSpy.


Funny for me, I tried a reboot. Fixed it for me. However, The reason it fixed it for me, is I had a rogue Excel.exe running hidden. The addin was not starting due to this other excel application running (I was migrating an MSAccess application to VSTO), so Access had an automation app open hidden.

In short, if your addin is not starting up, quick check for is to just make sure there's no other Excel applications running. This of course only applies when you're trying to get a brand new one installed/up and running.

(I used this link) https://www.add-in-express.com/creating-addins-blog/2012/11/13/wix-installation-vsto-office-addin/


There is also another possibility here as to why you are getting no feedback even with the Environment Variables mentioned above being set. I found if you were getting this error after an install (not a previous VSTO that had been working) you should also double check the registry and the "Manifest" entry if you have one.

While Jeremy Thompson points out the Registry in his Second bullet point he does not show the Manifest entry that could be part of your registry settings. If your Manifest entry is not pointing to the correct path and file it will show up in the Add-Ins listing with an entry of "Not Loaded".

Here we see a bad entry that just points to the VSTO file only, no path. 여기에 이미지 설명 입력

This will cause your AddIn to look like it loaded with errors, but no errors are popping up and appearing for you and making things frustrating. So it will look like this below, notice the location entry below also does not show the path. 여기에 이미지 설명 입력

Correct the entry by putting in the proper path along with the file name and it will fix this.

내가 생각하는 오류의 부족은 처음에는 아무것도 가리 키지 않았기 때문에로드 할 항목이 없더라도 레지스트리에 있기 때문에 AddIn을 나열합니다.


결국 나는 Word를 속여서 다음과 같이 말했습니다.

    Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateStartupObjectException: 
Could not create an instance of startup object blaghblagh ---> 
System.TypeInitializationException: The type initializer for 'foo' threw an exception. ---> 
System.IO.FileNotFoundException: Could not load file or assembly 'blah' or one of its dependencies. 
The system cannot find the file specified.

그 후 [1] 덕분에 FusLogvw는 신속하게 문제를 해결했습니다.

[1] 파일이나 어셈블리 또는 종속성 중 하나를로드 할 수 없습니다.

참고 URL : https://stackoverflow.com/questions/4668777/how-to-troubleshoot-a-vsto-addin-that-does-not-load

반응형