Skip to content
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

XAML files are not supported #810

Closed
tannergooding opened this issue Feb 3, 2017 · 10 comments
Closed

XAML files are not supported #810

tannergooding opened this issue Feb 3, 2017 · 10 comments

Comments

@tannergooding
Copy link
Member

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.

@tannergooding
Copy link
Member Author

FYI. @srivatsn, @jinujoseph, @nguerrera

@tannergooding
Copy link
Member Author

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
Copy link
Contributor

srivatsn commented Feb 3, 2017

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

@srivatsn
Copy link
Contributor

srivatsn commented Feb 3, 2017

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

@srivatsn srivatsn closed this as completed Feb 3, 2017
@dsplaisted
Copy link
Member

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

@dsplaisted dsplaisted reopened this Feb 4, 2017
@tannergooding
Copy link
Member Author

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

@gulbanana
Copy link

gulbanana commented Apr 20, 2017

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>

@gulbanana
Copy link

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>

@livarcocc livarcocc modified the milestones: 2.1.3xx, Discussion, Unknown Mar 29, 2018
mmitche pushed a commit to mmitche/sdk that referenced this issue Jun 5, 2020
Merge Master to release/3.0.1xx
Copy link
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.

@github-actions github-actions bot added the stale label Apr 25, 2024
Copy link
Contributor

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants