danca
danca

Reputation: 509

Visual Studio 2008 add-in cannot load external text file

I'm currently working on a simple add-in that is supposed to insert a copyright statement to a source file. It works fine but i would like the copyright text to live in a text file. This text file is being deployed to the same folder as the dll and .AddIn file.

But since the add-in could be installed in different folders on different machines the problem is now that I have not been able to figure out how to get the path to the text file programatically from the add-in code (c#). I've tried all kinds of reflection methods but non have worked so far.

If this is not possible or not the right approach please let me know what alternatives I have besides hardcoding the copyright text?

Thanks!

Upvotes: 1

Views: 92

Answers (1)

Jon Senchyna
Jon Senchyna

Reputation: 8047

If your text file is always in the same folder as the dll, then I think this related question should help you:

How do I get the path of the assembly the code is in?

Upvotes: 1

Related Questions