dotnet / dotnet/project-system

"DesignTimeReferences" doesn't return WinMD references which blocks XAML designer

Open
#2,815 3 comments 1 reaction 0 assignees View on GitHub
Feature-WinUI Parity-Legacy-API Parity-Legacy-Feature Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

XAML designer has the following code:

``` C#
private static References GetReferences(IHostProject project, out object connectionPointSource)
{
References references = null;
connectionPointSource = null;

Project proj = project.GetDTEProject();
if (proj != null)
{
Properties properties = proj.Properties;
if (properties != null)
{
foreach (Property prop in properties)
{
if (string.Equals(prop?.Name, "DesignTimeReferences", StringComparison.OrdinalIgnoreCase))
{
references = prop.Value as References;
connectionPointSource = references;
break;
}
}
}
}

if (references == null)
{
VSProject vsproj = project.GetVSProject();
if (vsproj != null)
{
references = vsproj.References;
connectionPointSource = vsproj.Events.ReferencesEvents;
}
}
return references;
}

```

This apparently does not return WinMD references for CPS projects. I don't have a good understanding of how this works yet so it needs investigation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.