Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2.3RC3 Regression] System.Text.Json package not found when building from editor (works via Visual Studio extension) #41241

Closed
JimArtificer opened this issue Aug 14, 2020 · 12 comments

Comments

@JimArtificer
Copy link

JimArtificer commented Aug 14, 2020

Godot version: 3.2.3RC3

OS/device including version: Windows 10 64bit (Visual Studio 2019 with Godot extension)

Issue description: I am using NuGet to include the System.Text.Json package in my Godot project. With previous versions of Godot I was able to build both from Visual Studio 2019 and from the editor.

Now, I am able to build and launch from Visual Studio 2019 using the Play in Editor button, but using Build, Play, or Play Scene from the editor results in a build process that cannot locate the System.Text.Json package.

The package is referenced in the .csproj file:

<PackageReference Include="System.Text.Json">
      <Version>4.7.2</Version>
</PackageReference>

Truncated build log from the editor:

Csc: Using shared compilation with compiler from directory: C:\Program Files\dotnet\sdk\3.1.401\Roslyn\bincore
Common\DictionaryTKeyEnumTValueConverter.cs(5,19): error CS0234: The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?) [V:\berg\Godot\Berg.csproj]

I attempted to uninstall the package and reinstall it. No change.

I understand why the editor and Visual Studio 2019 might use different build steps, but if that was an issue it doesn't make sense that this worked with Godot 3.2.2.

PackageRegression.zip

@JimArtificer JimArtificer changed the title [3.2.3RC3 Regression] System.Text.Json package not found when building from editor (works via visual studio extension) [3.2.3RC3 Regression] System.Text.Json package not found when building from editor (works via Visual Studio extension) Aug 14, 2020
@akien-mga akien-mga added this to the 3.2 milestone Aug 14, 2020
@akien-mga
Copy link
Member

Could you attach a minimal project that reproduces this issue? It greatly helps with debugging.

@JimArtificer
Copy link
Author

Could you attach a minimal project that reproduces this issue? It greatly helps with debugging.

Added.

@JimArtificer
Copy link
Author

I was able to fix my issue by changing the Build Tool editor setting to MSBuild (VS Build Tools). It was set back to the default dotnet CLI.

@neikeq neikeq reopened this Aug 14, 2020
@neikeq
Copy link
Contributor

neikeq commented Aug 14, 2020

Re-opening as this is still considered a bug, even if it can be worked around. We must figure out why it fails with the dotnet CLI or revert it being the default build tool.

@Thaina
Copy link
Contributor

Thaina commented Aug 17, 2020

I also got this problem and MSBuild (VS Build Tools) does not solve in my case

@neikeq
Copy link
Contributor

neikeq commented Aug 19, 2020

I wasn't able to reproduce on Linux. I'll try on Windows tomorrow. BTW, what version of the .NET Core SDK is installed on your system? (dotnet --version)

@Thaina
Copy link
Contributor

Thaina commented Aug 20, 2020

Turn out MSBuild (VS Build Tools) error was caused by difference problems and I have fix it

But dotnet cli and mono still not worked

I use dotnet 3.1.401

Also actually, trying to run dotnet build command line is not worked with godot project too. I could run dotnet clean and dotnet restore but dotnet build output the same error as in godot

@Duehok
Copy link

Duehok commented Aug 20, 2020

@Thaina
Copy link
Contributor

Thaina commented Aug 20, 2020

@Duehok I know, what I mean is, in godot there was option to use dotnet cli as build tool and that produce the same error CS0234

I could also run dotnet build from command line directly in godot project folder and it output the same error text

I just mention that dotnet restore can be run without error

@neikeq
Copy link
Contributor

neikeq commented Aug 20, 2020

Turn out MSBuild (VS Build Tools) error was caused by difference problems and I have fix it

Thanks, I had the idea this was an issue with the dotnet CLI only so I was worried to hear MSBuild (VS Build Tools) was having the same issue. Glad it wasn't the case.

But dotnet cli and mono still not worked

Mono's MSBuild is pretty much assumed not to work when it comes to nuget restore on Windows (no issues on Linux/macOS). At this point I wonder if it's better to remove it from the options, even if it's not the default anymore.

@akien-mga
Copy link
Member

Fixed by #40595 (master) and #41408 (3.2).

@astrolemonade
Copy link

This is still happening on 3.2.3-stable.mono

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants