Apple platform
macOS
Framework version
net10.0-*
Affected platform version
.net 10.0.201, macos workload 26.2.10217/10.0.100
Description
I'm trying to copy test.txt as a resource into the app bundle. I use the following in my csproj:
<ItemGroup>
<None Remove="test.txt"/>
<Content Include="test.txt">
<!-- <CopyToOutputDirectory>Always</CopyToOutputDirectory>-->
<PublishFolderType>Resource</PublishFolderType>
<!-- <Link>/Contents/Test123/test.txt</Link>-->
</Content>
</ItemGroup>
This works in Debug, but does not work in Release. No build errors, but also no test.txt in the output app bundle.
Steps to Reproduce
- Get test project macOSApp1.zip.
- this is just
dotnet new macos with added test.txt and it's configuration as an bundle resource.
- Build in debug and release:
dotnet build && dotnet build -c Release
- Check if the
test.txt is present in the ouptput: find ./bin/ -name "test.txt"
Expected: test.txt is found in both Debug and Release app bundles.
Actual: test.txt is found only in Debug
~/work/macOSApp1/macOSApp1$ find ./bin/ -name "test.txt"
./bin/Debug/net10.0-macos/osx-arm64/macOSApp1.app/Contents/Resources/test.txt
Did you find any workaround?
No response
Build logs
Release & Debug logs: binlogs.zip
Apple platform
macOS
Framework version
net10.0-*
Affected platform version
.net 10.0.201, macos workload 26.2.10217/10.0.100
Description
I'm trying to copy
test.txtas a resource into the app bundle. I use the following in my csproj:This works in Debug, but does not work in Release. No build errors, but also no
test.txtin the output app bundle.Steps to Reproduce
dotnet new macoswith addedtest.txtand it's configuration as an bundle resource.dotnet build && dotnet build -c Releasetest.txtis present in the ouptput:find ./bin/ -name "test.txt"Expected:
test.txtis found in bothDebugandReleaseapp bundles.Actual:
test.txtis found only inDebugDid you find any workaround?
No response
Build logs
Release & Debug logs: binlogs.zip