Comments (5)
I'm a little puzzled. Where does this dependency come from?
from soundfingerprinting.solr.
Ah I see, didn't notice the issue is on SoundFingerprinting.Solr :). Yeah, I'd love to remove it, but how would you then configure the endpoints? Do you have any examples?
from soundfingerprinting.solr.
You can keep all the config in xml, or move to json files if you want. Doesn't really matter. To use XML files, you need to add this NuGet package: Microsoft.Extensions.Configuration.Xml. I added the 1.0.0 to my project.json and added a appsettings.xml file.
<configuration>
<configSections>
<section name="solr" type="SoundFingerprinting.Solr.Config.SoundFingerprintingSolrConfigurationSection, SoundFingerprinting.Solr" />
</configSections>
<solr queryBatchSize="50" preferLocalShards="true">
<server id="tracks" url="http://localhost:8983/solr/sf_tracks" documentType="SoundFingerprinting.Solr.DAO.TrackDTO, SoundFingerprinting.Solr" />
<server id="fingerprints" url="http://localhost:8983/solr/sf_fingerprints" documentType="SoundFingerprinting.Solr.DAO.SubFingerprintDTO, SoundFingerprinting.Solr" />
</solr>
</configuration>
I then added it as part of configuration like this:
var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddXmlFile("appsettings.xml", optional: false, reloadOnChange: true)
.Build();
Then I can get the section by adding a reference to 'Microsoft.Extensions.Configuration.Binder' and calling:
SoundFingerprintingSolrConfigurationSection section = new SoundFingerprintingSolrConfigurationSection();
config.GetSection("solr").Bind(section);
You will have to tweak your Configuration object in order to get the binding to work with duplicate keys
from soundfingerprinting.solr.
Ah, it looks like SolrNet.Ninject is preventing this change.
It appears that this issue can be resolved by targeting multiple frameworks, please see my PR #2 PR #3
from soundfingerprinting.solr.
Nah this isn't going to solve anything. The ConfigurationManager was a red herring - the bigger issue is that this targets net46 and to do some things on azure netstandard/core is required. Since this is not possible for this project I'll close this issue and the pull request.
from soundfingerprinting.solr.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soundfingerprinting.solr.