Unexpected Config File Name Used When Opening csproj File
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit V2 |
Fix Released
|
High
|
Charlie Poole |
Bug Description
I'm running NUnit 2.5.2.9222 and Visual Studio 2008. I launch the NUnit GUI from with VS 2008 via an External Tool menu item by following the instructions on this documentation page: http://
For the External Tool's Arguments setting, I use: $(ProjectDir)
Note that the aforementioned documentation states "...the following command would load the tests using the configuration file nunit.tests.config located in the same directory as the csproj file.: nunit.exe nunit.tests.csproj"
However, contrary to what the documentation says, if my project is named "nunit.
This requirement to add ".csproj" to the file name is confirmed by outputting the value of "AppDomain.
What is really confusing is that if you click "Project..Edit" in the NUnit GUI, the "Project Editor" dialog shows the Configuration File Name as "nunit.
To summarize, in the case of opening a csproj file, I think either the NUnit GUI should be changed to use the name "nunit.
Related branches
Changed in nunitv2: | |
milestone: | none → 2.5.5 |
Changed in nunitv2: | |
status: | New → Triaged |
assignee: | nobody → Charlie Poole (charlie.poole) |
Changed in nunitv2: | |
status: | Triaged → Fix Committed |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
If it helps, I believe the config file name gets set in DomainManager.cs in the method "public AppDomain CreateDomain( TestPackage package)". The relevant code snippet is as follows (starts at line 75 in the DomainManager.cs source code for NUnit-2.5.2.9222):
-----snippet start------ IsProjectFile( testFile. Name) eWithoutExtensi on( testFile.Name ) + ".config"
configFile = NUnitProject.
? Path.GetFileNam
: testFile.Name + ".config";
-----snippet end------
In the debugger, I see that the ternary operator test returns false so configFile gets set to testFile.Name + ".config".
Since the value of testFile.Name is "nunit. tests.csproj" , the value of configFile becomes "nunit. tests.csproj. config" .