You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature-XAMLFeatures related to the XAML designer and display and manipulation of XAML files.Parity-Legacy-FeatureMissing features from the legacy project system.
Issue 1: XAML files are treated as None, when they should be treated as Page with Generator=MSBuild:Compile and SubType=Designer metadata.
Issue 2: Page items are not visible in the Solution Explorer
Issue 3: xaml.cs files are not properly nested under the xaml file
Issue 4: Compilation fails with: 1>C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(419,45): error MSB4057: The target "CoreCompile" does not exist in the project.
Reacted by bitbonk, Bruno Juchli, Julien Lebosquain, Tom Gilder, Igor Manushin, Squared Infinity, Mertsch, Nirmal Guru, ManniManfred, Jon Stelly and 4 more
For me it works good with VS2017 RC and the class library project (.NET Framework, not .NET Standard). I can include XAML files and everything is properly compiled, Intellisense works, etc.
The only issue I have is when I use globbing - the dependent .xaml.cs files are not nested. Reported there microsoft/VSProjectSystem#169
UPD. I also checked default class library project (the template with .NET Standard). After switching target to net461 it works but indeed it treats XAML as None... and manual setting it to Page leads to The target "CoreCompile" does not exist in the project error.
I was able to properly setup XAML files building with CPS for VS2017. @onovotny was right, with proper targets it works. I've added <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />. Also I added missing XAML rule for Page. And I've found a workaround for the issue with the dependent .xaml.cs files for files globbing (see link above).
Ok. I now understand this much better (@srivatsn).
WPF (and some other project types) generate a temporary project file that does not use the same extension as the original (WPF uses .tmp_proj, for example).
The SDK.targets uses the project extension to set LanguageTargets (provided LanguageTargets has not already been set). It then imports whatever LanguageTargets is set to (C# should be setting it to $(MSBuildToolsPath)\Microsoft.CSharp.targets, for example).
So the workaround is to ensure that LanguageTargets is set on any project type that hits the above issue.
I would think the proper fix, however, is to get the XAML targets (and any other targets that generate temporary projects) to use the original project extension.
@tannergooding, WPF is using temporary project because it need two-pass building to properly process XAML markup as described in this article on MSDN. So I'm afraid it might not be possible to avoid .tmp_proj.
@aienabled, i wasn't indicating it should avoid .tmp_proj, I'm saying t should usee the original projects file extension when doing so. Meaning instead of .tmp_proj, it should use .tmp_proj.csproj or just .csproj.
Tried to convert a XAML project to the new project format today and neither the LanguageTargets nor the MSBuild.Sdk.Extras worked although I also use the latest SDK. Given that .Net Core 3.0 is going to come soon, when are we going to see support for this?
There is imperfect XAML support already in the 3.0 nightly builds - pre-alpha stuff, but it’s definutely being implemented. I would expect full support (designer etc) to require vs2019. In the meantime, the workarounds people have described above are still functioning; I have a bunch of WPF libraries and applications using SDK projects.
Closing this as Xaml is now well supported in 16.1 and we have individual issues for the few gaps that remain. If there is a comment in this thread that represents something that is still an issue in Visual Studio 2019 please log a new issue.
Feature-XAMLFeatures related to the XAML designer and display and manipulation of XAML files.Parity-Legacy-FeatureMissing features from the legacy project system.
Activity
srivatsn commentedon Feb 3, 2017
From @tannergooding on February 3, 2017 22:56
FYI. @srivatsn, @jinujoseph, @nguerrera
srivatsn commentedon Feb 3, 2017
From @tannergooding on February 3, 2017 22:57
This completely blocks the porting of WPF based applications to CPS (I imagine it would also block UWP and anything else that uses XAML).
srivatsn commentedon Feb 3, 2017
Yes WPF and any other desktop projects are not supported yet. Currently only .NET Core projects are supported.
clairernovotny commentedon Feb 4, 2017
This should work with the right
LanguageTargets, shouldn't it?aienabled commentedon Feb 6, 2017
For me it works good with VS2017 RC and the class library project (.NET Framework, not .NET Standard). I can include XAML files and everything is properly compiled, Intellisense works, etc.
The only issue I have is when I use globbing - the dependent
.xaml.csfiles are not nested. Reported there microsoft/VSProjectSystem#169UPD. I also checked default class library project (the template with .NET Standard). After switching target to net461 it works but indeed it treats XAML as
None... and manual setting it toPageleads toThe target "CoreCompile" does not exist in the projecterror.aienabled commentedon Feb 7, 2017
I was able to properly setup XAML files building with CPS for VS2017.
@onovotny was right, with proper targets it works. I've added
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />. Also I added missing XAML rule forPage. And I've found a workaround for the issue with the dependent.xaml.csfiles for files globbing (see link above).tannergooding commentedon Feb 7, 2017
Ok. I now understand this much better (@srivatsn).
WPF (and some other project types) generate a temporary project file that does not use the same extension as the original (WPF uses .tmp_proj, for example).
The SDK.targets uses the project extension to set
LanguageTargets(providedLanguageTargetshas not already been set). It then imports whateverLanguageTargetsis set to (C# should be setting it to$(MSBuildToolsPath)\Microsoft.CSharp.targets, for example).So the workaround is to ensure that
LanguageTargetsis set on any project type that hits the above issue.I would think the proper fix, however, is to get the XAML targets (and any other targets that generate temporary projects) to use the original project extension.
aienabled commentedon Feb 8, 2017
@tannergooding, WPF is using temporary project because it need two-pass building to properly process XAML markup as described in this article on MSDN. So I'm afraid it might not be possible to avoid
.tmp_proj.davkean commentedon Feb 8, 2017
@aienabled Keep any bugs you file for managed concepts on this repro.
tannergooding commentedon Feb 8, 2017
@aienabled, i wasn't indicating it should avoid .tmp_proj, I'm saying t should usee the original projects file extension when doing so. Meaning instead of .tmp_proj, it should use .tmp_proj.csproj or just .csproj.
srivatsn commentedon Feb 8, 2017
@tannergooding can you file that as an internal bug on XAML?
tannergooding commentedon Feb 8, 2017
@srivatsn, I have logged VSO Bug: 382095 (not sure if the area path is correct, it seemed to be the best fit though).
gulbanana commentedon Apr 28, 2017
XAML needs PresentationBuildTasks, right, so is it correct that making this work in the SDK won't automatically make it work with
dotnet build?40 remaining items
bergmeister commentedon Nov 13, 2018
Tried to convert a XAML project to the new project format today and neither the
LanguageTargetsnor theMSBuild.Sdk.Extrasworked although I also use the latest SDK. Given that .Net Core 3.0 is going to come soon, when are we going to see support for this?gulbanana commentedon Nov 14, 2018
There is imperfect XAML support already in the 3.0 nightly builds - pre-alpha stuff, but it’s definutely being implemented. I would expect full support (designer etc) to require vs2019. In the meantime, the workarounds people have described above are still functioning; I have a bunch of WPF libraries and applications using SDK projects.
davkean commentedon Nov 14, 2018
Project system support, as per our roadmap https://github.com/dotnet/project-system/blob/master/docs/repo/roadmap.md, is in the 16.x timeframe.
davidwengier commentedon May 3, 2019
Closing this as Xaml is now well supported in 16.1 and we have individual issues for the few gaps that remain. If there is a comment in this thread that represents something that is still an issue in Visual Studio 2019 please log a new issue.
The issues that are still pending for Xaml support can be tracked here: https://github.com/dotnet/project-system/issues?q=is%3Aopen+is%3Aissue+label%3AFeature-XAML
Other teams will also have work pending (eg. the designer) but the workarounds called out in this thread should generally be no longer needed.
DzonnyDZ commentedon Aug 6, 2019
I posted possible (nasty) workaround for the issues with 2-pass build here: #5252