I switched from a HP Laptop running Windows 11 to a Mac Book running Sonoma.
My Balzor app is saved on a Git Repositroy.
On the Windows Laptop I can build and run the App without errors.
On the new Mac I installed dotnet (8.0.400) and cloned the git repository.
The exact same code that runs perfectly fine on the Windows Laptop throws errors on the Mac.
Executing:
dotnet build
throws the following errors:
[file/path].razor(283,34): error RZ1009: The "@" character must be followed by a ":", "(", or a C# identifier. If you intended to switch to markup, use an HTML start tag, for example: [[file/path].csproj]
[file/path].razor(137,34): error RZ1009: The "@" character must be followed by a ":", "(", or a C# identifier. If you intended to switch to markup, use an HTML start tag, for example: [[file/path].csproj]
[file/path].razor(11,20): error CS0116: Member, wie z. B. Felder, Methoden oder Anweisungen können nicht direkt in einem Namespace enthalten sein. [[file/path].csproj]
[file/path].razor(10,27): error CS0116: Member, wie z. B. Felder, Methoden oder Anweisungen können nicht direkt in einem Namespace enthalten sein. [[file/path].csproj]
[file/path].razor(9,31): error CS0116: Member, wie z. B. Felder, Methoden oder Anweisungen können nicht direkt in einem Namespace enthalten sein. [[file/path].csproj]
[file/path].razor(8,26): error CS0116: Member, wie z. B. Felder, Methoden oder Anweisungen können nicht direkt in einem Namespace enthalten sein. [[file/path].csproj]
[file/path].razor(9,20): error CS0116: Member, wie z. B. Felder, Methoden oder Anweisungen können nicht direkt in einem Namespace enthalten sein. [[file/path].csproj]
[file/path].razor(8,27): error CS0116: Member, wie z. B. Felder, Methoden oder Anweisungen können nicht direkt in einem Namespace enthalten sein. [[file/path].csproj]
[file/path].razor(7,31): error CS0116: Member, wie z. B. Felder, Methoden oder Anweisungen können nicht direkt in einem Namespace enthalten sein. [[file/path].csproj]
[file/path].razor(6,26): error CS0116: Member, wie z. B. Felder, Methoden oder Anweisungen können nicht direkt in einem Namespace enthalten sein. [[file/path].csproj]
[file/path].razor(9,20): error CS0102: Der Typ "<invalid-global-code>" enthält bereits eine Definition für "CPNAME". [[file/path].csproj]
[file/path].razor(8,27): error CS0102: Der Typ "<invalid-global-code>" enthält bereits eine Definition für "CPNAME". [[file/path].csproj]
[file/path].razor(7,31): error CS0102: Der Typ "<invalid-global-code>" enthält bereits eine Definition für "CPNAME". [[file/path].csproj]
[file/path].razor(6,26): error CS0102: Der Typ "<invalid-global-code>" enthält bereits eine Definition für "CPNAME". [[file/path].csproj]
(I replaced the filenames with [file/path] and the names of Components with CPNAME)
In order to narrow down the problem i created a new Blazor app on the Mac with the following command:
dotnet new blazor -o BlazorApp
I can build and run this Balzor App without errors.
Any ideas why I can’t build the project which I have cloned from the git repository from the working master branch?
Thanks in advance!
m4_lol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.