Skip to content

XAML files are not supported #810

Closed as not planned
Closed as not planned

Description

@tannergooding

Attached is a simple repro solution.
WpfCps.zip

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.

Activity

  1. tannergooding commented on Feb 3, 2017

    @tannergooding
    MemberAuthor
  2. tannergooding commented on Feb 3, 2017

    @tannergooding
    MemberAuthor

    This completely blocks the porting of WPF based applications to CPS (I imagine it would also block UWP and anything else that uses XAML).

  3. srivatsn commented on Feb 3, 2017

    @srivatsn
    Contributor

    Yes WPF and any other desktop projects are not supported yet. Currently only .NET Core projects are supported.

  4. added this to the milestone on Feb 3, 2017
  5. srivatsn commented on Feb 3, 2017

    @srivatsn
    Contributor

    This issue was moved to dotnet/project-system#1467

  6. dsplaisted commented on Feb 4, 2017

    @dsplaisted
    Member

    It seems like this issue is more about whether you can build a WPF project successfully rather than whether the IDE supports it.

  7. tannergooding commented on Feb 5, 2017

    @tannergooding
    MemberAuthor

    Yes. I can manually override things (as I did in the sample) so that the UI designer in VS and everything else works.

    I would think that, of the four issues I listed, two of them are applicable to the SDK repository (as they impact command line builds) and two to the Project System repository (they really only impact the IDE).

    SDK

    • Issue 1: XAML files are treated as None, when they should be treated as Page with Generator=MSBuild:Compile and SubType=Designer metadata.
    • 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.

    Project System:

    • Issue 2: Page items are not visible in the Solution Explorer
    • Issue 3: xaml.cs files are not properly nested under the xaml file
  8. gulbanana commented on Apr 20, 2017

    @gulbanana

    here are some workarounds for now

    issues 1 and 2:
    <Page Include="**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />

    issue 3:
    <Compile Update="**\*.xaml.cs" SubType="Code" DependentUpon="%(Filename)" />

    issue 4:
    <LanguageTargets>$(MSBuildToolsPath)\Microsoft.CSharp.targets</LanguageTargets>

  9. modified the milestones: , on May 16, 2017
  10. modified the milestones: 2.0.0, 2.1.0 on May 27, 2017
  11. gulbanana commented on Sep 19, 2017

    @gulbanana

    more complete version of the workarounds i use these days - import this at the end of a csproj

    <Project>  
      <!-- https://github.com/dotnet/sdk/issues/810 - the temporary project has the wrong file extension -->
      <PropertyGroup>
        <LanguageTargets>$(MSBuildToolsPath)\Microsoft.CSharp.targets</LanguageTargets>
        <StartWorkingDirectory Condition="'$(OutputType)' == 'WinExe'">bin/$(Configuration)/$(TargetFramework)</StartWorkingDirectory>
      </PropertyGroup>
      
      <!-- Page items aren't included by the SDK -->
      <ItemGroup>
        <Page Include="**\*.xaml" Exclude="@(ApplicationDefinition)" SubType="Designer" Generator="MSBuild:Compile" />
        <Compile Update="**\*.xaml.cs" SubType="Code" DependentUpon="%(Filename)" />
        <UpToDateCheckInput Include="**\*.xaml" />
      </ItemGroup>
    
      <!-- https://github.com/dotnet/project-system/issues/2488 - .g.cs files don't get built -->
      <Target Name="WorkaroundForXAMLIntellisenseBuildIssue" AfterTargets="_CheckCompileDesignTimePrerequisite">
        <PropertyGroup>
          <BuildingProject>false</BuildingProject>
        </PropertyGroup>
      </Target>
    </Project>
  12. modified the milestones: 2.1.3xx, Discussion, on Mar 29, 2018
  13. added a commit that references this issue on Jun 5, 2020
  14. github-actions commented on Apr 25, 2024

    @github-actions
    Contributor

    Due to lack of recent activity, this issue has been labeled as 'stale'. It will be closed if no further activity occurs within 30 more days. Any new comment will remove the label.

  15. github-actions commented on May 26, 2024

    @github-actions
    Contributor

    This issue will now be closed since it has been labeled 'stale' without activity for 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions