Skip to content

Commit 5cf7854

Browse files
jlaanstrakennykerr
authored andcommitted
Provide the correct path to the implementation dll. (#450)
1 parent add7eec commit 5cf7854

17 files changed

+290
-1
lines changed

nuget/Microsoft.Windows.CppWinRT.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
194194
<WinMDFullPath Include="$(CppWinRTProjectWinMD)" Condition="'$(CppWinRTGenerateWindowsMetadata)' == 'true'">
195195
<TargetPath>$([System.IO.Path]::GetFileName('$(CppWinRTProjectWinMD)'))</TargetPath>
196196
<Primary>true</Primary>
197-
<Implementation Condition="'$(TargetExt)' == '.dll'">$(WinMDImplementationPath)$(RootNamespace)$(TargetExt)</Implementation>
197+
<Implementation Condition="'$(TargetExt)' == '.dll'">$(WinMDImplementationPath)$(TargetName)$(TargetExt)</Implementation>
198198
<FileType>winmd</FileType>
199199
<WinMDFile>true</WinMDFile>
200200
<ProjectName>$(MSBuildProjectName)</ProjectName>

test/nuget/NuGetTest.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestStaticLibrary6", "TestS
3737
EndProject
3838
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestRuntimeComponentCSharp", "TestRuntimeComponentCSharp\TestRuntimeComponentCSharp.csproj", "{C47F8562-A2B9-4BA3-87AC-B42D015E241D}"
3939
EndProject
40+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestRuntimeComponentNamespaceUnderscore", "TestRuntimeComponentNamespaceUnderscore\TestRuntimeComponentNamespaceUnderscore.vcxproj", "{8717FA32-34A8-457D-B77B-AE005703EB55}"
41+
EndProject
4042
Global
4143
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4244
Debug|ARM = Debug|ARM
@@ -237,6 +239,20 @@ Global
237239
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x64.Build.0 = Release|x64
238240
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x86.ActiveCfg = Release|x86
239241
{C47F8562-A2B9-4BA3-87AC-B42D015E241D}.Release|x86.Build.0 = Release|x86
242+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|ARM.ActiveCfg = Debug|ARM
243+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|ARM.Build.0 = Debug|ARM
244+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|ARM64.ActiveCfg = Debug|Win32
245+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|x64.ActiveCfg = Debug|x64
246+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|x64.Build.0 = Debug|x64
247+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|x86.ActiveCfg = Debug|Win32
248+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Debug|x86.Build.0 = Debug|Win32
249+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|ARM.ActiveCfg = Release|ARM
250+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|ARM.Build.0 = Release|ARM
251+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|ARM64.ActiveCfg = Release|Win32
252+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x64.ActiveCfg = Release|x64
253+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x64.Build.0 = Release|x64
254+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x86.ActiveCfg = Release|Win32
255+
{8717FA32-34A8-457D-B77B-AE005703EB55}.Release|x86.Build.0 = Release|Win32
240256
EndGlobalSection
241257
GlobalSection(SolutionProperties) = preSolution
242258
HideSolutionNode = FALSE

test/nuget/TestApp/MainPage.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ using namespace winrt::TestRuntimeComponent2;
1010
using namespace winrt::TestRuntimeComponentCX;
1111
using namespace winrt::TestRuntimeComponentEmpty;
1212
using namespace winrt::TestRuntimeComponentEmpty::SubNamespace1;
13+
using namespace winrt::TestRuntimeComponent_NamespaceUnderscore;
1314

1415
namespace winrt::TestApp::implementation
1516
{
@@ -26,6 +27,9 @@ namespace winrt::TestApp::implementation
2627
TestRuntimeComponentCXClass c3{};
2728
c3.Test();
2829

30+
TestRuntimeComponentNamespaceUnderscoreClass cUnderscore{};
31+
cUnderscore.Test();
32+
2933
TestStaticLibrary1Class cStatic1{};
3034
cStatic1.Test();
3135

test/nuget/TestApp/TestApp.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@
165165
<ProjectReference Include="..\TestRuntimeComponentEmpty\TestRuntimeComponentEmpty.vcxproj">
166166
<Project>{8456c55f-bf01-4798-b79b-7388681c398f}</Project>
167167
</ProjectReference>
168+
<ProjectReference Include="..\TestRuntimeComponentNamespaceUnderscore\TestRuntimeComponentNamespaceUnderscore.vcxproj">
169+
<Project>{8717fa32-34a8-457d-b77b-ae005703eb55}</Project>
170+
</ProjectReference>
168171
<ProjectReference Include="..\TestStaticLibrary1\TestStaticLibrary1.vcxproj">
169172
<Project>{2158f418-ca97-4599-8103-efc133850baa}</Project>
170173
</ProjectReference>

test/nuget/TestApp/pch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
#include <winrt/TestRuntimeComponent2.h>
1919
#include <winrt/TestRuntimeComponentCX.h>
2020
#include <winrt/TestRuntimeComponentEmpty.SubNamespace1.h>
21+
#include <winrt/TestRuntimeComponent_NamespaceUnderscore.h>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ImportGroup Label="PropertySheets" />
4+
<PropertyGroup Label="UserMacros" />
5+
<!--
6+
To customize common C++/WinRT project properties:
7+
* right-click the project node
8+
* expand the Common Properties item
9+
* select the C++/WinRT property page
10+
11+
For more advanced scenarios, and complete documentation, please see:
12+
https://github.com/Microsoft/cppwinrt/tree/master/nuget
13+
-->
14+
<PropertyGroup />
15+
<ItemDefinitionGroup />
16+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
EXPORTS
2+
DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
3+
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(ProjectDir)..\..\..\nuget\Microsoft.Windows.CppWinRT.props" />
4+
<PropertyGroup Label="Globals">
5+
<CppWinRTOptimized>true</CppWinRTOptimized>
6+
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
7+
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
8+
<MinimalCoreWin>true</MinimalCoreWin>
9+
<ProjectGuid>{8717fa32-34a8-457d-b77b-ae005703eb55}</ProjectGuid>
10+
<ProjectName>TestRuntimeComponentNamespaceUnderscore</ProjectName>
11+
<RootNamespace>TestRuntimeComponent_NamespaceUnderscore</RootNamespace>
12+
<DefaultLanguage>en-US</DefaultLanguage>
13+
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
14+
<AppContainerApplication>true</AppContainerApplication>
15+
<ApplicationType>Windows Store</ApplicationType>
16+
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
17+
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
18+
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
21+
<ItemGroup Label="ProjectConfigurations">
22+
<ProjectConfiguration Include="Debug|ARM">
23+
<Configuration>Debug</Configuration>
24+
<Platform>ARM</Platform>
25+
</ProjectConfiguration>
26+
<ProjectConfiguration Include="Debug|Win32">
27+
<Configuration>Debug</Configuration>
28+
<Platform>Win32</Platform>
29+
</ProjectConfiguration>
30+
<ProjectConfiguration Include="Debug|x64">
31+
<Configuration>Debug</Configuration>
32+
<Platform>x64</Platform>
33+
</ProjectConfiguration>
34+
<ProjectConfiguration Include="Release|ARM">
35+
<Configuration>Release</Configuration>
36+
<Platform>ARM</Platform>
37+
</ProjectConfiguration>
38+
<ProjectConfiguration Include="Release|Win32">
39+
<Configuration>Release</Configuration>
40+
<Platform>Win32</Platform>
41+
</ProjectConfiguration>
42+
<ProjectConfiguration Include="Release|x64">
43+
<Configuration>Release</Configuration>
44+
<Platform>x64</Platform>
45+
</ProjectConfiguration>
46+
</ItemGroup>
47+
<PropertyGroup Label="Configuration">
48+
<ConfigurationType>DynamicLibrary</ConfigurationType>
49+
<PlatformToolset>v140</PlatformToolset>
50+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
51+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
52+
<CharacterSet>Unicode</CharacterSet>
53+
<GenerateManifest>false</GenerateManifest>
54+
</PropertyGroup>
55+
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
56+
<UseDebugLibraries>true</UseDebugLibraries>
57+
<LinkIncremental>true</LinkIncremental>
58+
</PropertyGroup>
59+
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
60+
<UseDebugLibraries>false</UseDebugLibraries>
61+
<WholeProgramOptimization>true</WholeProgramOptimization>
62+
<LinkIncremental>false</LinkIncremental>
63+
</PropertyGroup>
64+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
65+
<ImportGroup Label="ExtensionSettings">
66+
</ImportGroup>
67+
<ImportGroup Label="Shared">
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<ImportGroup Label="PropertySheets">
73+
<Import Project="PropertySheet.props" />
74+
</ImportGroup>
75+
<PropertyGroup Label="UserMacros" />
76+
<PropertyGroup />
77+
<ItemDefinitionGroup>
78+
<ClCompile>
79+
<PrecompiledHeader>Use</PrecompiledHeader>
80+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
81+
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
82+
<WarningLevel>Level4</WarningLevel>
83+
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
84+
<!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use -->
85+
<AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions>
86+
<DisableSpecificWarnings>
87+
</DisableSpecificWarnings>
88+
<PreprocessorDefinitions>_WINRT_DLL;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
89+
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
90+
</ClCompile>
91+
<Link>
92+
<SubSystem>Console</SubSystem>
93+
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
94+
<ModuleDefinitionFile>TestRuntimeComponentNamespaceUnderscore.def</ModuleDefinitionFile>
95+
</Link>
96+
</ItemDefinitionGroup>
97+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
98+
<ClCompile>
99+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
100+
</ClCompile>
101+
</ItemDefinitionGroup>
102+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
103+
<ClCompile>
104+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
105+
</ClCompile>
106+
<Link>
107+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
108+
<OptimizeReferences>true</OptimizeReferences>
109+
</Link>
110+
</ItemDefinitionGroup>
111+
<ItemGroup>
112+
<ClInclude Include="pch.h" />
113+
<ClInclude Include="TestRuntimeComponentNamespaceUnderscoreClass.h">
114+
<DependentUpon>TestRuntimeComponentNamespaceUnderscoreClass.idl</DependentUpon>
115+
</ClInclude>
116+
</ItemGroup>
117+
<ItemGroup>
118+
<ClCompile Include="pch.cpp">
119+
<PrecompiledHeader>Create</PrecompiledHeader>
120+
</ClCompile>
121+
<ClCompile Include="TestRuntimeComponentNamespaceUnderscoreClass.cpp">
122+
<DependentUpon>TestRuntimeComponentNamespaceUnderscoreClass.idl</DependentUpon>
123+
</ClCompile>
124+
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
125+
</ItemGroup>
126+
<ItemGroup>
127+
<Midl Include="TestRuntimeComponentNamespaceUnderscoreClass.idl" />
128+
</ItemGroup>
129+
<ItemGroup>
130+
<None Include="packages.config" />
131+
<None Include="TestRuntimeComponentNamespaceUnderscore.def" />
132+
</ItemGroup>
133+
<ItemGroup>
134+
<None Include="PropertySheet.props" />
135+
<Text Include="readme.txt">
136+
<DeploymentContent>false</DeploymentContent>
137+
</Text>
138+
</ItemGroup>
139+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
140+
<Import Project="$(ProjectDir)..\..\..\nuget\Microsoft.Windows.CppWinRT.targets" />
141+
</Project>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Resources">
5+
<UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
6+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
7+
</Filter>
8+
<Filter Include="Generated Files">
9+
<UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
10+
</Filter>
11+
</ItemGroup>
12+
<ItemGroup>
13+
<ClCompile Include="pch.cpp" />
14+
<ClCompile Include="Class.cpp" />
15+
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClInclude Include="pch.h" />
19+
</ItemGroup>
20+
<ItemGroup>
21+
<None Include="TestRuntimeComponentNamespaceUnderscore.def" />
22+
<None Include="packages.config" />
23+
</ItemGroup>
24+
<ItemGroup>
25+
<None Include="PropertySheet.props" />
26+
</ItemGroup>
27+
<ItemGroup>
28+
<Text Include="readme.txt" />
29+
</ItemGroup>
30+
<ItemGroup>
31+
<Midl Include="TestRuntimeComponentNamespaceUnderscoreClass.idl" />
32+
</ItemGroup>
33+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "pch.h"
2+
#include "TestRuntimeComponentNamespaceUnderscoreClass.h"
3+
#include "TestRuntimeComponentNamespaceUnderscoreClass.g.cpp"
4+
5+
namespace winrt::TestRuntimeComponent_NamespaceUnderscore::implementation
6+
{
7+
void TestRuntimeComponentNamespaceUnderscoreClass::Test()
8+
{
9+
}
10+
}

0 commit comments

Comments
 (0)