dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.06k stars 4.04k forks source link

c# Interactive System.BadImageFormatException: Could not load file or assembly #7663

Closed andrew-vdb closed 6 years ago

andrew-vdb commented 8 years ago

c# interactive window on Visual Studio 2015 Update 1 seems have problem when referencing x64 dll as we get System.BadImageFormatException exception

tmat commented 8 years ago

The hosting process is 32bit. We don't support 64bit currently, it's on our backlog though.

mjewkes commented 8 years ago

What needs to be done to support this? I'd love to use C# interactive to explore some >4GB datasets.

Sebazzz commented 8 years ago

Note that when running CSI directly, there is no issue.

poke commented 7 years ago

Any news on this? I’d really like to use the SharePoint DLLs from within the Interactive C# window but they require a 64bit process… :/

Aldebaran91 commented 7 years ago

C# interactive with 64bit would be very useful

PS: And also please enable multiple C# interactive views and graphic support ala Apple Swift Playground, Python, etc. etc.

ewinnington commented 7 years ago

When working in C# interactive and database drivers in 64 bit, I get this error.

It would be great to configure the c# interactive in VS to 64 bit

BrunoJuchli commented 6 years ago

What's the state of this now? I've got a x86 dll (using com components) and with VS 2017.7.3 I can't load the assembly because C# interative is running in x64 (also see https://stackoverflow.com/questions/49067671/vs-2017-c-sharp-interactive-is-not-a-valid-win32-application).

So i guess if you want to have C# Interactive on x86 dll you've ought to use VS2015, and if you want C# interactive on x64 you ought to use VS2017.

Or am I missing something?

It would be nice if VS2017 C# interactive would support both x64 and x86.

Note: error:

Could not load file or assembly '*****' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

  • AsyncTaskMethodBuilder.Start(ref TStateMachine)
tmat commented 6 years ago

It seems that some change inadvertently flipped the bitness to 64bit. Will investigate.

poke commented 6 years ago

Whatever that change was, can we get a toggle in the settings? 😅

tmat commented 6 years ago

Fixed by https://github.com/dotnet/roslyn/pull/28006.

The default stays as 64. #reset 32 switches to 32-bit, #reset 64 switches to 64-bit.