Nunit-console: No way to specify app.config with console runner

Created on 27 Jun 2017  路  6Comments  路  Source: nunit/nunit-console

@cyanite commented on Tue Jun 27 2017

Using nunit-console runner on individual dll's, there is no way to specify the app.config file to use. To do that you have to create an .nunit file and use configfile="app.config". There should be a command line option to do this.

We have a huge number of dll's which require assembly redirects and we don't have config files written for each of them, but only for our executables.

done feature normal

Most helpful comment

I see the problem. It would not be out of the question, in my view, for us to add a --configfile option. What we can't do - or at least I don't want to do - is have the option repeat and apply to the previous or following assembly. We do not have any position-dependency in the command-line now and I don't think we want to introduce it. So the option would apply to every assembly, which is what you want.

WRT multiple dlls on the command-line, we should be using the properly named (test.dll.config) file that is located in the same directory as the assembly. If not, it's a bug.

All 6 comments

If you don't use any command-line option, then nunit uses <yourtest>.dll.config. Doesn't this work in your situation?

@CharliePoole yes it can work, but the problem is that we would like to not copy 800 identical .config files (for the 800 dll's), so while we do have a kind of work-around, it would be great if you could specify this on the command line. This is for easier use in automated harvesting scripts that we use.

Sorry for opening the issue in the wrong project.

Another issue is when you mention multiple dll's on the command line. As far as I can see no app.config is loaded in that case.

I see the problem. It would not be out of the question, in my view, for us to add a --configfile option. What we can't do - or at least I don't want to do - is have the option repeat and apply to the previous or following assembly. We do not have any position-dependency in the command-line now and I don't think we want to introduce it. So the option would apply to every assembly, which is what you want.

WRT multiple dlls on the command-line, we should be using the properly named (test.dll.config) file that is located in the same directory as the assembly. If not, it's a bug.

I've labelled this as a feature to go on the backlog. It makes sense to me that you can access this functionality, which already exists for using in NUnit projects, directly from the command line. @nunit/engine-team - please shout up if anyone disagrees!

@cyanite - providing nobody objects, would you be interested in doing a PR for this? The functionality in the Engine already exists, it _should_ just be a matter of exposing that to the command line, I think.

it would be great if nunit can include app.config in the command

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaelrobayoGasTag picture michaelrobayoGasTag  路  5Comments

CharliePoole picture CharliePoole  路  7Comments

NaZaRKIN123 picture NaZaRKIN123  路  8Comments

elinato picture elinato  路  7Comments

CharliePoole picture CharliePoole  路  8Comments