c# - How to mock a statically referenced assembly? -
in c# have application.exe, uses library.dll (a compile-time reference). library.dll used communicate hardware, slow. possible create project in visual studio, create library.dll, mock. want able replace dll file without recompiling exe or replacing reference in visual studio. know can load dll @ run time, possible replace statically referenced dll without causing:
fileloadexception: located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040)
(i not use strong names)
it going pita, trying mimic dll mocking purpose.
i suggest put in feature in code, flag indicate wheteher code should run mock mode, not calling/invoke dll/reference @ all.
Comments
Post a Comment