c# - System.BadImageFormatException: Could not load file or assembly 'x_Accessor,...' This assembly is built by a runtime newer -
system.badimageformatexception: not load file or assembly 'x_accessor, version=0.0.0.0, culture=neutral, publickeytoken=null' or 1 of dependencies. assembly built runtime newer loaded runtime , cannot loaded.
i having hard time finding cure ailment...
i have created unit tests dot net test projects. default unit test framework.
the automated tool created accessor - used testing private methods.
[ know theory, private methods should tested through callers - then, depends on purpose, content, context , on... if can, test them.]
i have done in past on couple of projects, , worked fine.
but on these 2 projects trying test now, running problem...
note: using framework 3.5 - may issue ? - accessor should know !
i see absolutely can modify runtime assembly... imagine accessor.
and yes, did clean , rebuild, did erase output folder , rebuilt, did delete accessor , private method , re-create it.
please help me find how prepare ! give thanks you.
you can't reference assembly compiled in higher .net version (or version of clr more accurate). in illustration if have assembly unit tests .net 3.5 cannot reference assembly .net 4.0.
this reply looking think:
vs2010 sp1 unit tests targeting 3.5 framework fail if using private accessor
c# .net unit-testing accessor
No comments:
Post a Comment