Code Monkey home page Code Monkey logo

Comments (8)

Yegoroff avatar Yegoroff commented on August 11, 2024

thanks for highlighting these issues, I'll look on them and provide fixes.

from nconfig.

kiwidude68 avatar kiwidude68 commented on August 11, 2024

Hi mate, thanks for the reply. With a lot of experimentation I got something running in the end to do what I needed. I'm not quite sure why I had so many problems getting it to work, it did take quite a few hours, me being a numpty I guess and the examples not being quite what I was after.

In the end I think perhaps the only thing of the above that I didn't get resolved was the remove element not appearing to work (and those unit tests not seeming to make sense).

The other issue I had was (for a few months more) having to support .NET 3.5 only, so I had to make a few minor tweaks to the implementation to include it and compile the .NET 3.5 project. As per the separate issue I raised about strong naming we are having to do our own compile anyways but would be nice to get on an official package at some point.

Thanks again for your work on this.

from nconfig.

HeikoStudt avatar HeikoStudt commented on August 11, 2024

I did not subscribe to the feed, sorry for the late reply.
It is strange that the unit tests are not working as expected. I will try to look into your problems later.
The screenshots of your original issue seem to be lost?

MFG (sincerly)
HeikoStudt

from nconfig.

HeikoStudt avatar HeikoStudt commented on August 11, 2024

I've tried to reproduce your unit test behavior.

First, I had to install NUnit TestAdapter Nuget package for supporting Visual Studio 2017. I will create a Pull Request later.

Second, I had to change the nuget.config file to contain instead of .

Third, the test "Should_convert_passed_relative_paths_to_absolute_correctly" fails always. I am not quite sure why it might have changed. It fails in VS 2015 as well.

@Yegoroff Do you know why? What Visual Studio version do you use? Could we move upwards to VS 2017? Though it has its bugs/crashes, the new project structure allows for easy nuget package generation including multi-targeting.

Now, for the problem. :-)

If I comment the other files:

    private IEnumerable<FileInfo> GetFiles() {
            yield return new FileInfo(CONFIG_1);
            /*yield return new FileInfo(CONFIG_2);
            yield return new FileInfo(CONFIG_3);
            yield return new FileInfo(CONFIG_4);*/
        }

most of the unit tests are failing. The only ones going through are DeepMerger_MergeCollections_RemoveCollection and DeepMerger_MergeCollections_ClearCollection. If I understood correctly, you had the same behavior?

This is the case as you cannot test whether a non-existing element was removed/cleared or was never added. As the File1 contains the (and some adds), the end result must be exactly the File1 elements. For the remove I did not reread the details, but it holds the same fundamental idea.

As I cannot see the screenshots, I am currently not quite sure where the issue is. Can you please send me those or clearify otherwise?

MFG (sincerly)
Heiko Studt

from nconfig.

HeikoStudt avatar HeikoStudt commented on August 11, 2024

As I've seen now, those were no screenshots but code having < and > which are apparently removed by GitHub. My clear-Tag in my answer above was removed as well.
@kiwidude68 Please add those three blocks (File1, File2 and Expected) again via "Insert Code". Thanks!

MFG (sincerly)
HeikoStudt

from nconfig.

HeikoStudt avatar HeikoStudt commented on August 11, 2024

The IsReadOnly issue is in my opinion not a DeepMerger issue in itself, however DeepMerger writes in one configuration the merged data:

//A possible problem may be that we are overriding an element of a different config. for unmerging this is probably wrong //However, NConfig does not require us to be able to unmerge... var item = configs.First();

The above code in DeepMerger.cs could try to use reflection for creating a new element to merge into. For the moment, I did not investigate further, whether this is feasible at all.

MFG (sincerly)
HeikoStudt

from nconfig.

HeikoStudt avatar HeikoStudt commented on August 11, 2024

Finally yet another issue with it is it doesn't support the element, just gets ignored.
@kiwidude68 Again, please add the mentioned element as code or without < and >. Thanks.

MFG (sincerly)
HeikoStudt

from nconfig.

Yegoroff avatar Yegoroff commented on August 11, 2024

the latest commit backward compatibility of proj files, add new files to 3.5 project contains fixes for above mentioned issues with unit tests and .Net 3.5
As for the other reported cases, it looks like @kiwidude68 solved them.

from nconfig.

Related Issues (14)

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.