Closed AArnott closed 4 years ago
It seems to still be a problem, even for .NET Core WPF projects added to this repo:
1>------ Rebuild All started: Project: WpfApp1, Configuration: Debug Any CPU ------
1>D:\git\lib.template\src\WpfApp1\MainWindow.xaml.cs(23,16,23,26): warning CS1591: Missing XML comment for publicly visible type or member 'MainWindow.MainWindow()'
1>Done building project "WpfApp1_zk3lipur_wpftmp.csproj".
1>D:\git\lib.template\obj\WpfApp1\Debug\netcoreapp3.0\MainWindow.g.cs(58,21,58,38): error CS1504: Source file 'MainWindow.xaml' could not be opened -- Could not find file.
1>D:\git\lib.template\obj\WpfApp1\Debug\netcoreapp3.0\App.g.cs(51,21,51,31): error CS1504: Source file 'App.xaml' could not be opened -- Could not find file.
1>Done building project "WpfApp1.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
It is the presence of this in Directory.Build.props
:
That, in combination with redirecting the obj directory does it. Remove either one and it builds successfully.
I filed a bug against SourceLink: https://github.com/dotnet/sourcelink/issues/492
Add this within a <PropertyGroup>
in your WPF project file:
<EmbedUntrackedSources>false</EmbedUntrackedSources>
The XAML compiler seems to not like the read only source tree.
As reported by @bretjohnson