Tracing in Visio add-ins using a configuration file?

N

Niklas Deutschmann

Hi,

Is it possible to configure System.Diagnostics.Debug and
System.Diagnostics.Trace in a Visio add-in at runtime? I've created a VSTO
add-in using Visual Studio 2008.

The add-in will get installed in C:\Program Files\VisioAddin. Can I create a
configuration file, like in the TextWriterTraceListener example
http://msdn.microsoft.com/en-gb/library/system.diagnostics.textwritertracelistener(VS.80).aspx

Where do I have to place this configuration file?. I tried multiple
locations - C:\Program Files\VisioAddin\VisioAddin.config
- C:\Program Files\VisioAddin\VisioAddin.dll.config
(both assuming that there is a main assembly called VisioAddin.dll that
contains the startup method and that there is a VisioAddin.dll.manifest)
- VISIO.EXE.config in the Office installation directory

I've only found this example (for Outlook), in which a
TextWriterTraceListener is configured in code:
http://www.outlookcode.com/codedetail.aspx?id=1405

But I want it to be configurable at runtime.

Regards,
Niklas
 
S

Senaj Lelic [DE MVP Visio]

Hallo Niklas,

the addins are NOT installed themselves in the program files directory but
in a cached directory being part of the user profile.
I have created a small code that finds the place the addin runs - that is
the place where the config file should be from my point of view.
Do you know how to find the assembly installation path?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top