Closed CaseAlexander closed 4 years ago
Same error. Temp workaround on multi-target csproj:
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<Exec Command="XCOPY $(TargetDir)Microsoft.UI.Xaml $(TargetDir)$(ProjectName)\Microsoft.UI.Xaml\ /E /Y" />
<Exec Command="COPY $(TargetDir) $(TargetDir)$(ProjectName)" />
</Target>
Interesting. I tested the sample project on 16.4, and it did not crash for me.
@CaseAlexander @YZahringer I don't think this is a Forms Bug
I feel like this is a bug with https://github.com/onovotny/MSBuildSdkExtras
If I setup a project that isn't multitargeted then it builds fine without any errors. It's able to find the xr.xaml files just fine
@CaseAlexander @YZahringer
Can you try adding
<GenerateLibraryLayout>true</GenerateLibraryLayout>
To your multi targeted project and let me know if that fixes?
For me the following fixed the build exception on VS 16.3
<GenerateLibraryLayout>true</GenerateLibraryLayout>
We also tested the included project on VS 16.4 without adding GenerateLibraryLayout and it's able to compile without any issues. To me this looks like a bug in the VS targets around UWP when it gathers together everything it's going to use for the APPX package.
Closing for now as this doesn't look like an issue with Forms
@PureWeen I confirm, GenerateLibraryLayout
fix the build, thank you!
Description
Using XF 4.3 and above (including 4.4.0.936621-pre1), referencing a multi-target library from UWP gives error APPX0702 because it is looking for the .xr.xml and Compact.xbf files in the wrong location. Using XF 4.2 works perfectly.
Steps to Reproduce
(sample project included)
.csproj of class library
Expected Behavior
app should compile using XF 4.3+ as it does using XF 4.2-
Actual Behavior
APPX0702 error becuase looking in wrong folder for .xr.xml and Compact.xbf files
error APPX0702: Payload file '\bin\Debug\uap10.0.17763\ClassLibrary1\ClassLibrary1.xr.xml' does not exist.
error APPX0702: Payload file '\bin\Debug\uap10.0.17763\ClassLibrary1\Microsoft.UI.Xaml\DensityStyles\Compact.xbf' does not exist.
actual files are in '\bin\Debug\uap10.0.17763\ClassLibrary1.xr.xml'
'\bin\Debug\uap10.0.17763\Microsoft.UI.Xaml\DensityStyles\Compact.xbf'
Basic Information
Reproduction Link
DemoApp.zip