Coder Social home page Coder Social logo

Support for config files about nbench HOT 10 CLOSED

petabridge avatar petabridge commented on May 27, 2024
Support for config files

from nbench.

Comments (10)

Aaronontheweb avatar Aaronontheweb commented on May 27, 2024

@twenzel ah, so you're running the benchmark and the code inside the .DLL depends on values found inside the .config file via ConfigurationManager? Ok - do you know if there's a standard way to do that for a dependent assembly? The NBench.Runner.exe has its own App.config that loads but I don't know about being able to load multiple ones if you catch my drift.

from nbench.

twenzel avatar twenzel commented on May 27, 2024

At the moment I don't know how to do this. May be if the assembly is loaded in a dedicated AppDomain. I'll check the NUnit source because they're supporting this feature.

from nbench.

twenzel avatar twenzel commented on May 27, 2024

@Aaronontheweb You can provide the file name via the ConfigurationFile property on the AppDomainSetup class.

from nbench.

Aaronontheweb avatar Aaronontheweb commented on May 27, 2024

@twenzel so would that require loading the test assembly into its own AppDomain?

from nbench.

twenzel avatar twenzel commented on May 27, 2024

Yes. I guess this is the best option. When loading the test assembly into its own AppDomain you have control over the config file, the base path, private bin path, shadow copying. You can also change the target framework version.
You can even unload the assembly/appDomain so you can execute multiple benchmarks with different assemblies (even in parallel).

from nbench.

laitang2000 avatar laitang2000 commented on May 27, 2024

Where can i find the Nbench.runner.exe config? I'm trying to get to an EF connection string in the test.
Thanks

from nbench.

Aaronontheweb avatar Aaronontheweb commented on May 27, 2024

@twenzel looks like we're going to need to add some AppDomain loading support for this - I don't anticipate this being a huge amount of work.

@laitang2000 should be inside the same folder as the NBench.Runner.exe - if it's not in there you can add one.

from nbench.

Aaronontheweb avatar Aaronontheweb commented on May 27, 2024

@twenzel I'm going to be a bit delayed on adding support for that myself - would you like to take a stab at adding it and submitting a pull request?

from nbench.

twenzel avatar twenzel commented on May 27, 2024

Yes, you can assign this issue to me.

from nbench.

Aaronontheweb avatar Aaronontheweb commented on May 27, 2024

Closed by #75

from nbench.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.