.net - Newtson.Json FileLoadException only on CI server -
teamcity 9 , nunit 2.6.4 having problem running tests, works fine locally. issue seems reference newtonsoft.json (as usual).
test(s) failed. system.io.fileloadexception : not load file or assembly 'newtonsoft.json, version=6.0.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) @ system.net.http.formatting.basejsonmediatypeformatter..ctor() @ system.net.http.formatting.jsonmediatypeformatter..ctor() @ system.net.http.formatting.mediatypeformattercollection.createdefaultformatters() @ system.web.http.httpconfiguration.defaultformatters(httpconfiguration config) @ system.web.http.httpconfiguration..ctor(httproutecollection routes) @ mycompany.testing.webapi.controllertestassistant.prepareactioncontext(httprequestmessage request, ihttpcontroller controller) @ mycompany.web.http.httpresponsebuildertests.prepareactioncontext(httprequestmessage request) @ mycompany.web.http.httpresponsebuildertests.preparebuilder(string url) @ mycompany.web.http.httpresponsebuildertests.httpresponsebuilder_buildresponse__when__success_get_with_no_rowversion__then__200ok_with_no_etag() the solution huge. i've updated json.net package 7.x , i've checked binding references in config files.
everything locally on team's dev pcs. it's problem on build server, under nunit runner.
i think system.net.http.formatting has hard reference on version 6.x. it's if test runner isn't heeding binding redirects in config.
i'm going start weening myself off json.net, becoming more trouble worth, , doesn't vs provides no solving such problems.
thanks help.
luke
fusion log shows assembly binding redirect not being seen, though there. colleagues have sanity checked.
it's weird.
have removed other redirects in app.config test project , trying json.net redirect.
no application configuration file found
in fusion log, getting closer!
got it.
i had reference test dll, bin folder ended 2 *tests.dll files in it.
teamcity configured wildcard , ran tests in both. referenced dll had no config file , not load right version of json.net
the tests in referenced dll had been ran , passed. referenced test lib in order @ helper setup code!
normally, configure teamcity run tests on explicit dll paths.
Comments
Post a Comment