Skip to content

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

@z16

Description

@z16

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions