CSharpRepl icon indicating copy to clipboard operation
CSharpRepl copied to clipboard

error CS0518: Predefined type 'System.Object' is not defined or imported

Open z16 opened this issue 7 months ago • 1 comments

Version

C# REPL 0.6.7+d2955f13e744320cd6331c484e1286c3ed4f8612

What happened?

I'm running this on WSL using Ubuntu 22.04.5 LTS.

I'm trying to reference a local project. Currently that project is completely empty, no code files, and the csproj file is just this:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>net8.0</TargetFramework>
    </PropertyGroup>
</Project>

When I run csharprepl without parameters and no config file, then reference a local project doing this, it works as expected:

#r "/path/to/project/project.csproj

Launching it using this command line parameter works fine as well:

csharprepl -r /path/to/project/bin/Debug/net8.0/project.dll

However, when I launch it passing the csproj file as the command line parameter, I get an error:

csharprepl -r /path/to/project/project.csproj

The precise console output is this:

Image

This then breaks the entire REPL. It still shows the prompt character > but I cannot enter anything without getting this message, with the red border. Even just entering a number as an expression, like 3, gives the above error. As the image shows, it compiles fine. Compiling it manually via dotnet build also works. I have no idea how to debug this further, let me know if you want me to try something, if you can't reproduce it.

z16 avatar Jun 22 '25 18:06 z16

i'm also experiencing this on wsl (void linux). i've confirmed it first started happening with v0.6.0

tmr-danielcavanagh avatar Sep 05 '25 06:09 tmr-danielcavanagh