NUnit Testing and Application.LocalUserAppDataPath Property

Here’s a note to myself (and for anyone else that is doing Test Driven Development).  If you are using the Application.LocalUserAppDataPath property, when running tests, the properties value will not be the same as if you are running in the application.  That’s because LocalUserAppDataPath is built the following way: Base Path\ CompanyName\ ProductName\ ProductVersion, and the CompanyName, ProductName, and ProductVersion are all derived from the AppDomain.  The AppDomain gets this info from the AssemblyInfo attributes of the exe, not the dll.  Since I was testing a dll, the tests failed, since the exe that created the AppDomain was generated by my testing tool (TestDriven.Net), which did not have any of the AssemblyInfo attributes set.  The result was that the Application.LocalUserAppDataPath was User\1.0.0.0.  I’ve got to send a request to Jamie, and see if we can update the ProcessInvocation.exe to reflect the AssemblyInfo in the dll that is being tested.


The preceding blog entry has been syndicated from the DonXML Demsak’s All Things Techie Blog.  Please post all comments on the original post. 

No Comments