Создание нового проекта .NET 9.0 MAUI завершается сбоем с 13 ошибкамиC#

Место общения программистов C#
Ответить
Anonymous
 Создание нового проекта .NET 9.0 MAUI завершается сбоем с 13 ошибками

Сообщение Anonymous »

Как следует из названия, сборка проекта не удалась, было обнаружено 13 ошибок сборки. Я только что обновил Visual Studio 2022 и отметил все необходимые параметры. Создание нового проекта и его сборка немедленно завершаются сбоем.
Для получения дополнительной информации я запускаю его на компьютере под управлением Windows, который завершает работу с ошибкой net9.0-windows10.0.19041.0< /strong>.
Выдает следующие ошибки

Код: Выделить всё

1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.WinUI.App.WinRTVtable.g.cs(4,40,4,53): error CS0118: 'global::WinRT' is a namespace but is used like a type
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.WinUI.App.WinRTVtable.g.cs(4,57,4,80): error CS0103: The name 'RandomiserVtableClasses' does not exist in the current context
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.WinUI.App.WinRTVtable.g.cs(4,2,4,122): error CS1729: 'WinRTExposedTypeAttribute' does not contain a constructor that takes 3 arguments
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.App.WinRTVtable.g.cs(4,40,4,53): error CS0118: 'global::WinRT' is a namespace but is used like a type
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.App.WinRTVtable.g.cs(4,57,4,80): error CS0103: The name 'RandomiserVtableClasses' does not exist in the current context
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.App.WinRTVtable.g.cs(4,2,4,121): error CS1729: 'WinRTExposedTypeAttribute' does not contain a constructor that takes 3 arguments
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.MainPage.WinRTVtable.g.cs(4,40,4,53): error CS0118: 'global::WinRT' is a namespace but is used like a type
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.MainPage.WinRTVtable.g.cs(4,57,4,80): error CS0103: The name 'RandomiserVtableClasses' does not exist in the current context
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.MainPage.WinRTVtable.g.cs(4,2,4,121): error CS1729: 'WinRTExposedTypeAttribute' does not contain a constructor that takes 3 arguments
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.AppShell.WinRTVtable.g.cs(4,40,4,53): error CS0118: 'global::WinRT' is a namespace but is used like a type
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.AppShell.WinRTVtable.g.cs(4,57,4,80): error CS0103: The name 'RandomiserVtableClasses' does not exist in the current context
1>C:\Users\115al\Documents\GitHub\5e-Monster-Randomiser-.NET-Maui-App\5e Randomiser\obj\Debug\net9.0-windows10.0.19041.0\win10-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\_5e_Randomiser.AppShell.WinRTVtable.g.cs(4,2,4,121): error CS1729: 'WinRTExposedTypeAttribute' does not contain a constructor that takes 3 arguments
1>Done building project "5e Randomiser.csproj"  -- FAILED.
Я попытался исправить следующее:

Код: Выделить всё

dotnet clean
dotnet build

Код: Выделить всё

dotnet workload install maui-windows

Код: Выделить всё

Re-Creating a new project

Код: Выделить всё

dotnet restore
dotnet build

Код: Выделить всё

Installing .NET 9.0 through - [link][1]

[1]: https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-9.0.101-windows-x64-installer

Я действительно не знаю, что еще я могу сделать, чтобы попытаться исправить это, поскольку даже искусственный интеллект не мог мне помочь.

Подробнее здесь: https://stackoverflow.com/questions/793 ... -13-errors
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»