Get the assembly path but not the temporary path where the assembly is running

I am really breaking my head for the simple unit testing i am writing!

[TestFixture]
Class A
{

  [TestMethod]
  public void test()
  {
      Assembly.GetExecutingAssembly().Location // gives some temporary local path
  }

 }

All i want is to get the path of the assembly location (where my project folder resides) not some local or temporary folder.

This folder is what I get if I put a breakpoint: AppDataLocalTemp

Any help is greatly appreciated!

EDIT: I tried doing this with both nUnit as well as MSTest microsoft's unit testing! Nothing helps.


你试过了吗

AppDomain.CurrentDomain.BaseDirectory   
链接地址: http://www.djcxy.com/p/21104.html

上一篇: 为什么C#中的字节减法需要强制转换?

下一篇: 获取装配路径,但不是装配正在运行的临时路径