Home > database >  I have a problem with run code on platform dotnet
I have a problem with run code on platform dotnet

Time:05-02

When I write in console dotnet run, I get message about error

error:

..\main.cs(3,35): error CS0246: Не удалось найти тип или имя пространства имен "Window" (возможно, отсутствует директива using или ссылка на сборку). [..\2dgame.csproj]                                                      

Ошибка сборки. Устраните ошибки сборки и повторите попытку.

code:

using System;
using System.Windows;
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
}

CodePudding user response:

Try to clean the project delete bin and obj folders and then rebuild.

CodePudding user response:

There's an error with the 'Window' object, the compiler is telling you to fix that. Then try to:

  • Clean the Bin and Obj file.
  • Run dotnet run in the same directory as the .csproj file.
  • Related