-
Notifications
You must be signed in to change notification settings - Fork 515
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
[.NET 6] Files copies into MonoBundle get folder structure flattened #12386
Comments
I suppose the problem is somewhere here: xamarin-macios/dotnet/targets/Xamarin.Shared.Sdk.targets Lines 958 to 976 in 4371133
The copied files have the |
This should do as a workaround: <None Update="cs\*.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<DestinationSubDirectory>cs</DestinationSubDirectory>
</None> |
Thanks. It's a bit tricky for us since we use |
Would this work? <None Update="cs\*.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<DestinationSubDirectory>%(None.Directory)</DestinationSubDirectory>
</None> |
I seemed to have luck when changing this: xamarin-macios/dotnet/targets/Xamarin.Shared.Sdk.targets Lines 959 to 962 in 4371133
to <ResolvedFileToPublish
Update="@(ResolvedFileToPublish)"
RelativePath="$(_AssemblyPublishDir)\%(ResolvedFileToPublish.RelativePath)"
Condition="'%(Extension)' == '.dll' Or ('$(_BundlerDebug)' == 'true' And '%(Extension)' == '.pdb') Or '%(Extension)' == '.exe'" /> |
Fixes xamarin#12386 (and likely xamarin#12418)
This is a bit more complicated than just making sure the relative path is correct, because it touches upon a few important questions:
<None Update="Something.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
For legacy Xamarin, we said to use either |
I'm not sure there is an uniformly correct answer to your questions. The default is the root of the app bundle and Since The |
Just to answer myself: Well, it does not... kinda... it puts it into |
The BDN issue (#12418) is actually caused by using the same |
I'm not sure I agree, I lean towards changing our current logic to not copy .dll files either (when they come from items with I see three alternatives: Enforce explicitness This would be to only put
The downside is of course that nothing that currently uses Define "output directory" to something We could define the output directory for OTOH if you do this for resources, you won't get the behavior you want (and you'll have to use Guess Come up with rules like:
This raises more questions though (what about MyAssembly.dll.config? MyAssembly.xml? MyAssembly.pdb?), and seems brittle and unnecessarily complex. |
I did a cursory GitHub search and checked few pages of the usages. Then I did the same for our sources (including 3rd-party libraries) and for some StackOverflow answers. Apparently my expectations about the usage were somewhat distorted but there are three main usages that are common:
Whatever is the final decision I would expect the behavior of |
Another related issue is what to do about frameworks: #12440 (comment) - that issue in particular is about multiple frameworks in the same NuGet, but a related point is where to put frameworks in general. We might end with a mix of "Guess" and "Define 'output directory' to something":
|
And this should be considered as well: #11667 |
I believe this to be the same as #12572 (which is a more general issue), so I'm closing this one in favor of that one. |
Steps to Reproduce
dotnet build
Expected Behavior
MailClient.Import.Wab.resources.dll
should be located in./bin/Debug/net6.0-macos/osx-x64/macos-debug.app/Contents/MonoBundle/cs
Actual Behavior
MailClient.Import.Wab.resources.dll
is located in./bin/Debug/net6.0-macos/osx-x64/macos-debug.app/Contents/MonoBundle
(path component is lost)Environment
.NET 6 Preview 6
Build Logs
msbuild.binlog.zip
Example Project (If Possible)
Archive.zip
The text was updated successfully, but these errors were encountered: