Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAUI Hybrid fails to build on Mac when a JSON file is present #21633

Closed
datvm opened this issue Apr 4, 2024 · 1 comment
Closed

MAUI Hybrid fails to build on Mac when a JSON file is present #21633

datvm opened this issue Apr 4, 2024 · 1 comment
Labels
platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working

Comments

@datvm
Copy link

datvm commented Apr 4, 2024

Description

Unfortunately since #17078 is not getting reopened, I am creating this issue.

When a MAUI with Razor project (Sdk="Microsoft.NET.Sdk.Razor") is compiled on MacOS with dotnet build, if there is a JSON file, it always fails with the following error:

MyFile/test-ja.json : error : The path '../../../../../../../../../Users/lukevo/Documents/Temp/TestLib/MyFile/test-ja.json' would result in a file outside of the app bundle and cannot be used. [/Users/lukevo/Documents/Temp/TestLib/TestLib.csproj::TargetFramework=net8.0-ios]
MyFile/test-ja.json : error :          [/Users/lukevo/Documents/Temp/TestLib/TestLib.csproj::TargetFramework=net8.0-ios]
MyFile/test.json : error : The path '../../../../../../../../../Users/lukevo/Documents/Temp/TestLib/MyFile/test.json' would result in a file outside of the app bundle and cannot be used. [/Users/lukevo/Documents/Temp/TestLib/TestLib.csproj::TargetFramework=net8.0-ios]
MyFile/test.json : error :          [/Users/lukevo/Documents/Temp/TestLib/TestLib.csproj::TargetFramework=net8.0-ios]

It doesn't matter if the JSON is referred by the project or not. No matter which combination you use below, the error always shows up.

	<ItemGroup>
		<!-- <None Remove="MyFile/**/*" /> -->
		<!-- <EmbeddedResource Include="MyFile/**/*" /> -->
	</ItemGroup>

It doesn't happen when compiling the same code on Windows.

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/datvm/MauiHybridJsonFail

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

No response

Did you find any workaround?

Build on Windows.

Relevant log output

No response

@datvm datvm added the t/bug Something isn't working label Apr 4, 2024
@drasticactions
Copy link
Contributor

@datvm You're correct, that issue is still happening and shouldn't have been closed. I reopened it, and am closing this one.

@drasticactions drasticactions closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants