dafny-lang / dafny

Dafny is a verification-aware programming language
https://dafny.org
Other
2.85k stars 256 forks source link

/compile:3 C# compiler doesn't find library DLL and crashes #266

Open mschlaipfer opened 5 years ago

mschlaipfer commented 5 years ago

A call like the following, referencing a C# library DLL

Dafny.exe Test.dfy extern.cs library.dll /compile:3

results in the output:

Dafny 2.3.0.10506

Dafny program verifier finished with 2 verified, 0 errors
Compiled program written to Test.cs
Running...

Error: Execution resulted in exception: Exception has been thrown by the target of an invocation.
System.IO.FileNotFoundException: Could not load file or assembly 'BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942' or one of its dependencies. The system cannot find the file specified.
File name: 'BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942'
  <snip>

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
mschlaipfer commented 5 years ago

This issue might be due to me assuming that DLLs are statically linked into the EXE. But leaving this open for now.

robin-aws commented 2 years ago

Might be expected behavior but labeling as bug until proven otherwise.