diff --git a/nuget/Microsoft.Windows.CppWinRT.targets b/nuget/Microsoft.Windows.CppWinRT.targets index 22a7f24d6..2a4ba0928 100644 --- a/nuget/Microsoft.Windows.CppWinRT.targets +++ b/nuget/Microsoft.Windows.CppWinRT.targets @@ -308,11 +308,14 @@ Copyright (C) Microsoft Corporation. All rights reserved. $(CppWinRTProjectWinMD) + Instead they are passed as independent inputs for the component projection. --> <_MdMergeInputs Include="@(CppWinRTStaticProjectWinMDReferences)" Condition="'$(ConfigurationType)' != 'StaticLibrary'"> $(CppWinRTProjectWinMD) <_MdMergeReferences Remove="@(_MdMergeReferences)" /> + + <_MdMergeReferences Include="@(CppWinRTStaticProjectWinMDReferences)" Condition="'$(ConfigurationType)' == 'StaticLibrary'" /> <_MdMergeReferences Include="@(CppWinRTDirectWinMDReferences)" /> <_MdMergeReferences Include="@(CppWinRTDynamicProjectWinMDReferences)" /> <_MdMergeReferences Include="@(CppWinRTPlatformWinMDReferences)" /> diff --git a/test/nuget/Directory.Build.props b/test/nuget/Directory.Build.props index cd0f519cc..9f410480b 100644 --- a/test/nuget/Directory.Build.props +++ b/test/nuget/Directory.Build.props @@ -6,7 +6,10 @@ - + + x86 + $(Platform) + false diff --git a/test/nuget/TestApp/MainPage.cpp b/test/nuget/TestApp/MainPage.cpp index e9542ed46..eaa0fa26f 100644 --- a/test/nuget/TestApp/MainPage.cpp +++ b/test/nuget/TestApp/MainPage.cpp @@ -5,6 +5,8 @@ using namespace winrt; using namespace Windows::UI::Xaml; +using namespace winrt::TestApp::Library1; +using namespace winrt::TestApp::Library4; using namespace winrt::TestRuntimeComponent1; using namespace winrt::TestRuntimeComponent2; using namespace winrt::TestRuntimeComponentCX; @@ -30,12 +32,12 @@ namespace winrt::TestApp::implementation TestRuntimeComponentNamespaceUnderscoreClass cUnderscore{}; cUnderscore.Test(); - TestStaticLibrary1Class cStatic1{}; - cStatic1.Test(); - TestStaticLibrary4Class cStatic4{}; cStatic4.Test(); + TestStaticLibrary1Class cStatic1{}; + cStatic1.Test(cStatic4); + TestStaticLibrary5Class cStatic5{}; cStatic5.Test(); diff --git a/test/nuget/TestApp/pch.h b/test/nuget/TestApp/pch.h index 64d2f7ef6..9eca07882 100644 --- a/test/nuget/TestApp/pch.h +++ b/test/nuget/TestApp/pch.h @@ -14,6 +14,8 @@ #include #include +#include +#include #include #include #include diff --git a/test/nuget/TestRuntimeComponent2/module.cpp b/test/nuget/TestRuntimeComponent2/module.cpp index f75dda00f..71a3cfad2 100644 --- a/test/nuget/TestRuntimeComponent2/module.cpp +++ b/test/nuget/TestRuntimeComponent2/module.cpp @@ -40,9 +40,7 @@ int32_t __stdcall WINRT_CanUnloadNow() noexcept int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noexcept try { - uint32_t length{}; - wchar_t const* const buffer = WINRT_WindowsGetStringRawBuffer(classId, &length); - std::wstring_view const name{ buffer, length }; + std::wstring_view const name{ *reinterpret_cast(&classId) }; *factory = winrt_get_activation_factory(name); if (*factory) diff --git a/test/nuget/TestRuntimeComponent3/module.cpp b/test/nuget/TestRuntimeComponent3/module.cpp index 53f741204..328607f68 100644 --- a/test/nuget/TestRuntimeComponent3/module.cpp +++ b/test/nuget/TestRuntimeComponent3/module.cpp @@ -45,9 +45,7 @@ int32_t __stdcall WINRT_CanUnloadNow() noexcept int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noexcept try { - uint32_t length{}; - wchar_t const* const buffer = WINRT_WindowsGetStringRawBuffer(classId, &length); - std::wstring_view const name{ buffer, length }; + std::wstring_view const name{ *reinterpret_cast(&classId) }; *factory = winrt_get_activation_factory(name); if (*factory) diff --git a/test/nuget/TestRuntimeComponentCSharp/TestRuntimeComponentCSharp.csproj b/test/nuget/TestRuntimeComponentCSharp/TestRuntimeComponentCSharp.csproj index 5d80b00fd..869819889 100644 --- a/test/nuget/TestRuntimeComponentCSharp/TestRuntimeComponentCSharp.csproj +++ b/test/nuget/TestRuntimeComponentCSharp/TestRuntimeComponentCSharp.csproj @@ -18,23 +18,6 @@ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} false - - AnyCPU - true - full - false - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - prompt - 4 - - - AnyCPU - pdbonly - true - TRACE;NETFX_CORE;WINDOWS_UWP - prompt - 4 - x86 true diff --git a/test/nuget/TestRuntimeComponentEmpty/module.cpp b/test/nuget/TestRuntimeComponentEmpty/module.cpp index 2f43efa83..6b05bab9a 100644 --- a/test/nuget/TestRuntimeComponentEmpty/module.cpp +++ b/test/nuget/TestRuntimeComponentEmpty/module.cpp @@ -45,9 +45,7 @@ int32_t __stdcall WINRT_CanUnloadNow() noexcept int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noexcept try { - uint32_t length{}; - wchar_t const* const buffer = WINRT_WindowsGetStringRawBuffer(classId, &length); - std::wstring_view const name{ buffer, length }; + std::wstring_view const name{ *reinterpret_cast(&classId) }; *factory = winrt_get_activation_factory(name); if (*factory) diff --git a/test/nuget/TestStaticLibrary1/TestStaticLibrary1.vcxproj b/test/nuget/TestStaticLibrary1/TestStaticLibrary1.vcxproj index a6d96fcc5..ec6dcd3fc 100644 --- a/test/nuget/TestStaticLibrary1/TestStaticLibrary1.vcxproj +++ b/test/nuget/TestStaticLibrary1/TestStaticLibrary1.vcxproj @@ -8,7 +8,7 @@ {2158F418-CA97-4599-8103-EFC133850BAA} StaticLibrary TestStaticLibrary1 - TestApp + TestApp.Library1 en-US 14.0 true diff --git a/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.cpp b/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.cpp index 11afb0dc5..bafb77c92 100644 --- a/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.cpp +++ b/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.cpp @@ -2,11 +2,12 @@ #include "TestStaticLibrary1Class.h" #include "TestStaticLibrary1Class.g.cpp" -namespace winrt::TestApp::implementation +using namespace winrt::TestApp::Library4; + +namespace winrt::TestApp::Library1::implementation { - void TestStaticLibrary1Class::Test() + void TestStaticLibrary1Class::Test(TestStaticLibrary4Class const& c) { - TestStaticLibrary4Class c{}; c.Test(); } } diff --git a/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.h b/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.h index d607d1f2a..e0ee8607b 100644 --- a/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.h +++ b/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.h @@ -1,16 +1,16 @@ #pragma once #include "TestStaticLibrary1Class.g.h" -namespace winrt::TestApp::implementation +namespace winrt::TestApp::Library1::implementation { struct TestStaticLibrary1Class : TestStaticLibrary1ClassT { TestStaticLibrary1Class() = default; - void Test(); + void Test(TestApp::Library4::TestStaticLibrary4Class const& c); }; } -namespace winrt::TestApp::factory_implementation +namespace winrt::TestApp::Library1::factory_implementation { struct TestStaticLibrary1Class : TestStaticLibrary1ClassT { diff --git a/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.idl b/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.idl index 21ca2e064..2fd032ea3 100644 --- a/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.idl +++ b/test/nuget/TestStaticLibrary1/TestStaticLibrary1Class.idl @@ -1,10 +1,10 @@ -namespace TestApp +namespace TestApp.Library1 { [default_interface] runtimeclass TestStaticLibrary1Class { TestStaticLibrary1Class(); - void Test(); + void Test(TestApp.Library4.TestStaticLibrary4Class c); } } diff --git a/test/nuget/TestStaticLibrary1/pch.h b/test/nuget/TestStaticLibrary1/pch.h index 88b755b1e..8e182119d 100644 --- a/test/nuget/TestStaticLibrary1/pch.h +++ b/test/nuget/TestStaticLibrary1/pch.h @@ -7,4 +7,4 @@ #define WIN32_LEAN_AND_MEAN -#include "winrt/TestApp.h" +#include "winrt/TestApp.Library4.h" diff --git a/test/nuget/TestStaticLibrary4/TestStaticLibrary4.vcxproj b/test/nuget/TestStaticLibrary4/TestStaticLibrary4.vcxproj index c23830ec0..86fea6326 100644 --- a/test/nuget/TestStaticLibrary4/TestStaticLibrary4.vcxproj +++ b/test/nuget/TestStaticLibrary4/TestStaticLibrary4.vcxproj @@ -33,7 +33,7 @@ true {432068a4-b206-4468-9254-446cceb15a2c} StaticLibrary - TestApp + TestApp.Library4 en-US 14.0 true diff --git a/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.cpp b/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.cpp index 92f4af864..3e3fe80d3 100644 --- a/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.cpp +++ b/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.cpp @@ -7,7 +7,7 @@ using namespace winrt; using namespace winrt::Windows::UI::Xaml::Core::Direct; -namespace winrt::TestApp::implementation +namespace winrt::TestApp::Library4::implementation { XamlDirect TestStaticLibrary4Class::Test() { diff --git a/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.h b/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.h index 8214874f7..554832de3 100644 --- a/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.h +++ b/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.h @@ -2,7 +2,7 @@ #include "TestStaticLibrary4Class.g.h" -namespace winrt::TestApp::implementation +namespace winrt::TestApp::Library4::implementation { struct TestStaticLibrary4Class : TestStaticLibrary4ClassT { @@ -12,7 +12,7 @@ namespace winrt::TestApp::implementation }; } -namespace winrt::TestApp::factory_implementation +namespace winrt::TestApp::Library4::factory_implementation { struct TestStaticLibrary4Class : TestStaticLibrary4ClassT { diff --git a/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.idl b/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.idl index 53d5b39b2..3eeada0da 100644 --- a/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.idl +++ b/test/nuget/TestStaticLibrary4/TestStaticLibrary4Class.idl @@ -1,4 +1,4 @@ -namespace TestApp +namespace TestApp.Library4 { [default_interface] runtimeclass TestStaticLibrary4Class