dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.89k stars 385 forks source link

Error: input.fsx (1,1)-(1,1) typecheck error The module/namespace 'System.IO' from compilation unit 'System.Runtime' did not contain the namespace, module or type 'FileInfo' #1776

Open kurt-mueller-osumc opened 2 years ago

kurt-mueller-osumc commented 2 years ago

Describe the bug

Please provide as much information as you can.

Ever since I updated my project to .net6.0, dotnet-interactive no longer runs my code. Instead I get the following error when running a cell:

Error: input.fsx (1,1)-(1,1) typecheck error The module/namespace 'System.IO' from compilation unit 'System.Runtime' did not contain the namespace, module or type 'FileInfo'

Screen Shot 2021-11-18 at 12 00 52 PM

Obviously, System.IO does define FileInfo. Of note, if i comment out the last line, the error disappears.

Also, this code works fine in FSharp Interactive.

How should I go about debugging / getting to the bottom of this? Thanks for any help.

Please complete the following:

Which version of .NET Interactive are you using? There are a few ways to find this out:

$ dotnet interactive --version
1.0.255902+b0afbdc47dec91e62b0c5cb587a0f2c24242eca8
brettfo commented 2 years ago

Can you paste the version that VS Code reports when you run #!about? Both in VS Code and VS Code - Insiders.

kurt-mueller-osumc commented 2 years ago

VS Code Version: 1.0.255902+b0afbdc47dec91e62b0c5cb587a0f2c24242eca8

VS Code Insiders Version: 1.0.256801+86af10f211eed3508fa5c9c957cf3fa5ddf5cfe9