c# - Determine the source of an indirect dependency on incorrect .NET Framework version -
i know how can determine source of build error;
warning 4 primary reference "mynamespace.myproject" not resolved because has indirect dependency on .net framework assembly "system.xml, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" has higher version "4.0.0.0" version "2.0.0.0" in current target framework. mynamespace.myotherproject i understand meaning of error (and 5 others same project), cannot work out how resolve in case. 'primary reference' in case (mynamespace.myproject) has no direct dependencies on .net 4.0.x.
the primary reference depends on 1 other project of mine (mynamespace.mycoreproject), source project build (mynamespace.myotherproject) depends directly on. , build not complaining that project having indirect references .net 4.0.x, assume can rule out.
the primary reference has direct dependency on 3 (3) 3rd party dlls, of target .net 2.0.
i have employed dotpeek examine built libraries, , cannot see reference using .net 4.0.
the other potential spanner in works use of postsharp, directly referenced 'mynamespace.mycoreproject' (referenced primary reference project), may causing problem, believe there related vs2010 bug when referencing postsharp.dll (http://www.sharpcrafters.com/forum/topic4444-4-1.aspx#bm4462), removed build chain , still see error, assume can rule that out.
if can tell me why happening, fantastic! if not, direction on how work out unnamaed 'indirect reference' helpful!
incidentally, have tried of following tools info, they're not telling me didn't know (which direct dependencies of dll in question); - .net reflector - dotpeek - ildasm - depends (dependency walker)
whilst have not worked out way solve problem of determining how msbuild determines references uses (why not tell me how comes these indirect references, instead of making me guess don't know...) have solved problem.
in end, removed references in 'primary reference' project, (which required excluding code piece piece - painful process) determine source of supposed indirect reference .net 4.0 libs caused 3rd party dll referenced.
however, believe there bug in msbuild behind problem, as;
- the 3rd party dll referenced 'browse' specific dll file on machine - 1 explicitly depends on .net 2.0
- setting 'specific version' true in build did nothing fix this
- msbuild appeared going gac different version of dll , causing incorrect reference error.
now, curiosity i've not touched or changed relevant libs in time, has started happening other unrelated reason - may be, don't know.
in end, way found solve issue run gacutil /u each of relevant libs remove installed/used versions of 4.0 libs. (there 40 in package, painful! package's uninstaller did not remove libs in gac)
this seems have let msbuild start using references told to, rather coming own idea of 'use file' , 'use specific version means.
solved, have loved cleaner way this!
Comments
Post a Comment