mirror of
https://github.com/marticliment/WinGet-API-from-CSharp
synced 2026-06-21 13:57:37 +00:00
Remove unused nuget packages
This commit is contained in:
@@ -22,17 +22,12 @@
|
||||
<ItemGroup>
|
||||
<CsWinRTInputs Include="$(TargetDir)\Microsoft.Management.Deployment.winmd" />
|
||||
<Content Include="$(TargetDir)\Microsoft.Management.Deployment.winmd" Link="Microsoft.Management.Deployment.winmd" CopyToOutputDirectory="PreserveNewest" />
|
||||
<Content Include="$(TargetDir)\Microsoft.Management.Configuration.dll" Link="Microsoft.Management.Configuration.dll" CopyToOutputDirectory="PreserveNewest" />
|
||||
<Content Include="$(TargetDir)\Microsoft.Management.Configuration.winmd" Link="Microsoft.Management.Configuration.winmd" CopyToOutputDirectory="PreserveNewest" />
|
||||
|
||||
<!-- This DLL from the winget COM interop package allows activating the winget server elevated -->
|
||||
<Content Include="$(TargetDir)\winrtact.dll" Link="winrtact.dll" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Management.Infrastructure" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.7" />
|
||||
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta">
|
||||
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
|
||||
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
@@ -48,20 +43,15 @@
|
||||
- Feed the $(TargetDir)\WINMD path to CsWinRT in order to generate the projected classes
|
||||
NOTE: Suppressing the warning only is not enough as this will cause CoreClrInitFailure (0x80008089) error.
|
||||
-->
|
||||
<PackageReference Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.7.10091-preview">
|
||||
<PackageReference Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.5.1572">
|
||||
<NoWarn>NU1701</NoWarn>
|
||||
<GeneratePathProperty>true</GeneratePathProperty>
|
||||
<IncludeAssets>none</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.WindowsPackageManager.Configuration.OutOfProc" Version="1.7.10091-preview">
|
||||
<GeneratePathProperty>True</GeneratePathProperty>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CopyWinmdToTargetDir" BeforeTargets="BeforeBuild">
|
||||
<Copy SourceFiles="$(PkgMicrosoft_WindowsPackageManager_ComInterop)\lib\Microsoft.Management.Deployment.winmd" DestinationFolder="$(TargetDir)" />
|
||||
<Copy SourceFiles="$(PkgMicrosoft_WindowsPackageManager_ComInterop)\runtimes\win10-$(Platform)\native\winrtact.dll" DestinationFolder="$(TargetDir)" />
|
||||
<Copy SourceFiles="$(PkgMicrosoft_WindowsPackageManager_Configuration_OutOfProc)\runtimes\win10-$(Platform)\native\Microsoft.Management.Configuration.dll" DestinationFolder="$(TargetDir)" />
|
||||
<Copy SourceFiles="$(PkgMicrosoft_WindowsPackageManager_Configuration_OutOfProc)\runtimes\win10-$(Platform)\native\Microsoft.Management.Configuration.winmd" DestinationFolder="$(TargetDir)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ public class WindowsPackageManagerStandardFactory : WindowsPackageManagerFactory
|
||||
var pUnknown = IntPtr.Zero;
|
||||
try
|
||||
{
|
||||
var hr = PInvoke.CoCreateInstance(clsid, null, CLSCTX.CLSCTX_LOCAL_SERVER, iid, out var result);
|
||||
var hr = PInvoke.CoCreateInstance(clsid, null, CLSCTX.CLSCTX_ALL, iid, out var result);
|
||||
Marshal.ThrowExceptionForHR(hr);
|
||||
pUnknown = Marshal.GetIUnknownForObject(result);
|
||||
return MarshalGeneric<T>.FromAbi(pUnknown);
|
||||
|
||||
Reference in New Issue
Block a user