Trouble with Code - 'Remoting' does not exist in System.Runtime?

Hi, I am a bit lost in the course since my code does not work. Can some one please help me out? I would be really grateful! I am attaching some snapshots where I think is an error (underlined with red line) from the code and can even paste it all here. Thank you for the help in advance!

using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Activation;//Comment
using UnityEngine;

public class Hacker : MonoBehaviour
{
int level;

enum Screen { MainMenu, Password, Win};
Screen currentScreen = Screen.MainMenu();

// Start is called before the first frame update
void Start()
{
    ShowMainMenu();
}
void ShowMainMenu()
{
    Terminal.ClearScreen();
    Terminal.WriteLine("Welcome to the gaming terminal!");
    Terminal.WriteLine("     ");
    Terminal.WriteLine("Choose Level:  ");
    Terminal.WriteLine("Press 1 for Easy");
    Terminal.WriteLine("Press 2 for Medium");
    Terminal.WriteLine("Press 3 for Hard");
    Terminal.WriteLine("Enter your selection: ");
}
void OnUserInput(string input)
{
    if (input == "menu")
    {
        ShowMainMenu();
    }
    else if (input == "1")
    {
        level = 1;
        StartGame();
    }
    else if (input == "2")
    {
        level = 2;
        StartGame();
    }
    else if (input == "3")
    {
        level = 3;
        StartGame();
    }
    else
    {
        Terminal.WriteLine("Please select 1, 2 or 3!");
    }
}
void StartGame()
{
    currentScreen = Screen.Password();
    Terminal.WriteLine("You have chosen level " + level);
    Terminal.WriteLine("Please provide a password");
}

}

Hi,

Please remove all namespaces that you do not need. For example these two:

using System.Runtime.InteropServices;
using System.Runtime.Remoting.Activation;//Comment

Did this fix it?

Hi, yes it did! Thank you!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms