Help! Code runs forever if I don't copy exactly what is in the solution (C# Interface Lesson Finish Truck Class)

I’m working on the C# interface lesson (https://www.codecademy.com/courses/learn-c-sharp/lessons/csharp-interfaces/exercises/finish-truck-class) and I’ve been having a lot of trouble with it.

I’ve written code that is very similar to the solution, but doesn’t exactly match it, and when I click Run it either spins forever or takes several minutes to output an error. The one error I’ve gotten is

/usr/share/dotnet/sdk/3.1.421/NuGet.targets(128,5): error : Failed to retrieve information about ‘Microsoft.NET.Test.Sdk’ from remote source ‘https://api.nuget.org/v3-flatcontainer/microsoft.net.test.sdk/index.json‘. [/home/ccuser/workspace/csharp-interfaces-finish-truck-class/LearnInterfaces.csproj]

Can someone please help me? I’d really like to continue the course without having to ‘cheat’ by copying the solution every time.

Thanks!

At the bottom of the exercise, there should be a “Copy to Clipboard” button.
Click on the button to copy all your code.

To paste the code in the forums with proper formatting, use the </> button.
See this post for more details: [How to] Format code in posts

There are 5 steps in the exercise. Which step is giving you the error?

The second step is what was giving me the error. However, when I retried running the (unchanged) code this morning it worked. So maybe there was an environmental issue? Are there any steps I can take in the future to avoid this kind of error?

Here is the code in question:

using System; namespace LearnInterfaces { class Truck : IAutomobile { public string LicensePlate { get; } public double Speed { get; private set; } public int Wheels { get; } public double Weight { get; } public void Honk() { Console.WriteLine("HONK!"); } public Truck(double speed, double weight) { Speed = speed; Weight = weight; LicensePlate = Tools.GenerateLicensePlate(); if (weight < 400) { Wheels = 8; } else { Wheels = 12; } } } }

Thank you!

Another user posted about a similar error message from a different exercise of the C# course.

Most likely it may have been a problem at Codecademy’s end.

Maybe that’s why whenever I try to run my code it takes several minutes to check it.

I’ll try that again tomorrow, I hope Codecamedy is aware of this issue.