Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 23aa307

Browse files
committed
Use ProvideBindingPath to resolve icon from UI assembly
Visual Studio doens't know where to find assemblies used in the .imagesmanifest file. Use ProvideBindingPath to make assemblies in the `UI` folder discoverable.
1 parent d4a5b93 commit 23aa307

File tree

8 files changed

+160
-22
lines changed

8 files changed

+160
-22
lines changed

src/GitHub.VisualStudio.16.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.VisualStudio.16", "G
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.VisualStudio.TestApp", "GitHub.VisualStudio.TestApp\GitHub.VisualStudio.TestApp.csproj", "{8BA418B2-DCB2-4E89-82A0-93B36F2B8FFE}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.VisualStudio.UI.16", "GitHub.VisualStudio.UI.16\GitHub.VisualStudio.UI.16.csproj", "{00423E7A-0838-4BE1-9263-181006DFF96B}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +23,10 @@ Global
2123
{8BA418B2-DCB2-4E89-82A0-93B36F2B8FFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
2224
{8BA418B2-DCB2-4E89-82A0-93B36F2B8FFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
2325
{8BA418B2-DCB2-4E89-82A0-93B36F2B8FFE}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{00423E7A-0838-4BE1-9263-181006DFF96B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{00423E7A-0838-4BE1-9263-181006DFF96B}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{00423E7A-0838-4BE1-9263-181006DFF96B}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{00423E7A-0838-4BE1-9263-181006DFF96B}.Release|Any CPU.Build.0 = Release|Any CPU
2430
EndGlobalSection
2531
GlobalSection(SolutionProperties) = preSolution
2632
HideSolutionNode = FALSE

src/GitHub.VisualStudio.16/GitHub.VisualStudio.16.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,13 @@
231231
</EmbeddedResource>
232232
</ItemGroup>
233233
<ItemGroup>
234-
<Page Include="Resources\icons\mark_github.xaml">
235-
<Generator>MSBuild:Compile</Generator>
236-
<SubType>Designer</SubType>
237-
</Page>
234+
<ProjectReference Include="..\GitHub.VisualStudio.UI.16\GitHub.VisualStudio.UI.16.csproj">
235+
<Project>{00423E7A-0838-4BE1-9263-181006DFF96B}</Project>
236+
<Name>GitHub.VisualStudio.UI.16</Name>
237+
<VSIXSubPath>UI</VSIXSubPath>
238+
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bBuiltProjectOutputGroupDependencies%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
239+
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup%3b</IncludeOutputGroupsInVSIXLocalOnly>
240+
</ProjectReference>
238241
</ItemGroup>
239242
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
240243
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />

src/GitHub.VisualStudio.16/Images.imagemanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ImageManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/VisualStudio/ImageManifestSchema/2014">
22
<Symbols>
3-
<String Name="Resources" Value="/GitHub.VisualStudio.16;component/Resources/icons" />
3+
<String Name="Resources" Value="/GitHub.VisualStudio.UI.16;component/Resources/icons" />
44
<Guid Name="guidImages" Value="{de556d01-f3bc-4521-abc3-3e04b537f9c9}" />
55
<ID Name="logo" Value="1" />
66
</Symbols>

src/GitHub.VisualStudio.16/StartPagePackage.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
namespace GitHub.StartPage
1212
{
13+
// Allow assemblies in the UI directory to be resolved by their full or partial name.
14+
// This is required for .imagemanifest files, XAML and when using unsigned assemblies.
15+
// See: https://github.com/github/VisualStudio/pull/1236/
16+
[ProvideBindingPath(SubPath = "UI")]
17+
1318
[PackageRegistration(UseManagedResourcesOnly = true)]
1419
[Guid(Guids.StartPagePackageId)]
1520
[ProvideCodeContainerProvider("GitHub Container", Guids.StartPagePackageId, Images.ImageMonikerGuid, Images.Logo, "#110", "#111", typeof(GitHubContainerProvider))]
Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
3-
<Metadata>
4-
<Identity Id="GitHubCore.f4fbb70d-dee2-4dee-b322-bd74e3010e8f" Version="1.0" Language="en-US" Publisher="Jamie Cansdale" />
5-
<DisplayName>GitHubCore</DisplayName>
6-
<Description>Empty VSIX Project.</Description>
7-
</Metadata>
8-
<Installation>
9-
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[16.0, 17.0)" />
10-
</Installation>
11-
<Dependencies>
12-
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
13-
</Dependencies>
14-
<Prerequisites>
15-
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[16.0,17.0)" DisplayName="Visual Studio core editor" />
16-
</Prerequisites>
17-
<Assets>
18-
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
19-
</Assets>
3+
<Metadata>
4+
<Identity Id="GitHubCore.f4fbb70d-dee2-4dee-b322-bd74e3010e8f" Version="1.0" Language="en-US" Publisher="Jamie Cansdale" />
5+
<DisplayName>GitHubCore</DisplayName>
6+
<Description>Empty VSIX Project.</Description>
7+
</Metadata>
8+
<Installation>
9+
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[16.0, 17.0)" />
10+
</Installation>
11+
<Dependencies>
12+
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
13+
</Dependencies>
14+
<Prerequisites>
15+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[16.0,17.0)" DisplayName="Visual Studio core editor" />
16+
</Prerequisites>
17+
<Assets>
18+
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
19+
<Asset Type="Microsoft.VisualStudio.Assembly" d:Source="Project" d:ProjectName="GitHub.VisualStudio.UI.16" d:VsixSubPath="UI" Path="|GitHub.VisualStudio.UI.16|" AssemblyName="|GitHub.VisualStudio.UI.16;AssemblyName|" />
20+
</Assets>
2021
</PackageManifest>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{00423E7A-0838-4BE1-9263-181006DFF96B}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<RootNamespace>GitHub.VisualStudio.UI._16</RootNamespace>
10+
<AssemblyName>GitHub.VisualStudio.UI.16</AssemblyName>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
<Deterministic>true</Deterministic>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<PropertyGroup>
38+
<StartupObject />
39+
</PropertyGroup>
40+
<ItemGroup>
41+
<Reference Include="System" />
42+
<Reference Include="System.Data" />
43+
<Reference Include="System.Xml" />
44+
<Reference Include="Microsoft.CSharp" />
45+
<Reference Include="System.Core" />
46+
<Reference Include="System.Xml.Linq" />
47+
<Reference Include="System.Data.DataSetExtensions" />
48+
<Reference Include="System.Net.Http" />
49+
<Reference Include="System.Xaml">
50+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
51+
</Reference>
52+
<Reference Include="WindowsBase" />
53+
<Reference Include="PresentationCore" />
54+
<Reference Include="PresentationFramework" />
55+
</ItemGroup>
56+
<ItemGroup>
57+
<Page Include="Resources\icons\mark_github.xaml">
58+
<Generator>MSBuild:Compile</Generator>
59+
<SubType>Designer</SubType>
60+
</Page>
61+
</ItemGroup>
62+
<ItemGroup>
63+
<Compile Include="Properties\AssemblyInfo.cs">
64+
<SubType>Code</SubType>
65+
</Compile>
66+
</ItemGroup>
67+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
68+
</Project>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System.Reflection;
2+
using System.Resources;
3+
using System.Runtime.CompilerServices;
4+
using System.Runtime.InteropServices;
5+
using System.Windows;
6+
7+
// General Information about an assembly is controlled through the following
8+
// set of attributes. Change these attribute values to modify the information
9+
// associated with an assembly.
10+
[assembly: AssemblyTitle("GitHub.VisualStudio.UI.16")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("")]
14+
[assembly: AssemblyProduct("GitHub.VisualStudio.UI.16")]
15+
[assembly: AssemblyCopyright("Copyright © 2019")]
16+
[assembly: AssemblyTrademark("")]
17+
[assembly: AssemblyCulture("")]
18+
19+
// Setting ComVisible to false makes the types in this assembly not visible
20+
// to COM components. If you need to access a type in this assembly from
21+
// COM, set the ComVisible attribute to true on that type.
22+
[assembly: ComVisible(false)]
23+
24+
//In order to begin building localizable applications, set
25+
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
26+
//inside a <PropertyGroup>. For example, if you are using US english
27+
//in your source files, set the <UICulture> to en-US. Then uncomment
28+
//the NeutralResourceLanguage attribute below. Update the "en-US" in
29+
//the line below to match the UICulture setting in the project file.
30+
31+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32+
33+
34+
[assembly: ThemeInfo(
35+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36+
//(used if a resource is not found in the page,
37+
// or application resource dictionaries)
38+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39+
//(used if a resource is not found in the page,
40+
// app, or any theme specific resource dictionaries)
41+
)]
42+
43+
44+
// Version information for an assembly consists of the following four values:
45+
//
46+
// Major Version
47+
// Minor Version
48+
// Build Number
49+
// Revision
50+
//
51+
// You can specify all the values or you can default the Build and Revision Numbers
52+
// by using the '*' as shown below:
53+
// [assembly: AssemblyVersion("1.0.*")]
54+
[assembly: AssemblyVersion("1.0.0.0")]
55+
[assembly: AssemblyFileVersion("1.0.0.0")]

src/GitHub.VisualStudio.16/Resources/icons/mark_github.xaml renamed to src/GitHub.VisualStudio.UI.16/Resources/icons/mark_github.xaml

File renamed without changes.

0 commit comments

Comments
 (0)