dotnet / dotnet/android

CS1504 with AndroidBoundLayout when building with .NET 8 SDK

Open
#8,516 9 comments 0 reactions 2 assignees Claimed by @jonathanpeppers View on GitHub
Area: App+Library Build
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 20h
Merged PRs (30d)
257

Description

### Android application type

.NET Android (net7.0-android, etc.)

### Affected platform version

VS 2022 17.8

### Description

After upgrading to VS2022 17.8, I cannot build my .NET 7 Android app anymore. Same issue with `dotnet build`.

For every Android layout file with build action 'AndroidBoundLayout', I'm getting the build error:

`project\obj\Debug\net7.0-android33.0\generated\Binding.About.g.cs(27,11): error CS1504: Source file 'Resources\Layout\About.xml' could not be opened -- Could not find file.`

The generated .cs file contains code `#line 2 "Resources\Layout\About.xml"` which seems to break compiling.

### Steps to Reproduce

Use .NET 8 SDK to build a project with AndroidBoundLayout file.

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.