question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable IntelliSense for XAML resources not work

See original GitHub issue

image

image

image

image

Translation: error netsdk1022 Duplicate 'Page' items were included. The .NET SDK includes 'Page' items from your project directory by default .....

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ShankarBUScommented, Jul 25, 2020

Ohhhhh… I got it

The problem is the DesignTimeResources.xaml is not a Page it is a ResourceDictionary only used by Visual Studio only during Design Time. You included it as a page and it will be compiled into the source code.

Follow these steps Step 1 : Move the DesignTimeResources.xaml file in to Properties (create one if not existing) folder (not necessary but this will prevent it from mingling with other xaml files)

Example : image

Step 2 : Add this in your csproj file instead

  <ItemGroup>
    <Page Remove="Properties\DesignTimeResources.xaml" />
  </ItemGroup>

  <ItemGroup>
    <None Include="Properties\DesignTimeResources.xaml">
      <ContainsDesignTimeResources>True</ContainsDesignTimeResources>
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </None>
  </ItemGroup>
1reaction
GF-Huangcommented, Jul 25, 2020

If I add <ItemGroup> <Page>...</Page> </ItemGroup> into the *.csproj, it will cause the project building failure as above NETSDK1022 error.

If I remove the <ItemGroup> <Page>...</Page> </ItemGroup> node from *.csproj, it becomes no building errors, but when I typing <SomeElement someAttribute={StaticResource }> in VS xaml editor, it does not show any resources such as SystemControlForegroundBaseMediumBrush etc…

image

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

XAML intellisense not showing suggestions for resources ...
Enable all .NET exceptions in "debugger ". Menu Debug > Windows > Exception Settings, then check Common Language Runtime Errors. 7. Switch to...
Read more >
wpf - Visual Studio Intellisense not working on XAML only ...
Try building the project and deploying the project. There may be error in some dll or in some C# code. Try fixing all...
Read more >
XAML code autocomplete (Intellisense) is disabled/ greyed ...
I uninstalled resharper and xaml auto complete does not working anymore. What I have tried: stackoverflow.com answer, not working; Repare by vs ...
Read more >
VS 2015: Xaml IntelliSense not working in UI for WPF
Hi guys! I installed the new Visual Studio 2015, and created a new Telerik WPF project with reference to Telerik.Windows.Controls, Telerik.
Read more >
Intellisense
If Visual Studio Intellisense unable to locate resources that are stored in a ResourceDictionary, follow this guide: First, create a new ResourceDictionary ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found