I have a question about adding SDKReference in a Windows Store Project during installation of my nuget package.
My nuget package dépends on two SDK installed:
- Microsoft Visual C++ Runtime Package
- SQLite (installed by VSIX installation)
I have tried many things to complete this task :
- Adding a target file in the build directory : Doesn't work. (Btw, i used this target file to solve the ARM/x86/x64 problem, and it works correctly)
- Adding an install.ps1 in tools directory : Work partially :)
The problem come from the "Refresh project" behavior :
Here is my install.ps1 powershell script :
param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.LoadProject($project.FullName) | Select-Object -First 1
# Grab the target framework version and identifier from the loaded MSBuild proect
$targetFrameworkIdentifier = $msbuild.GetProperty("TargetFrameworkIdentifier").Xml.Value
if ($targetFrameworkIdentifier -eq ".NETCore")
# Add a group to store SDks
$group = $msbuild.Xml.AddItemGroup();
$vcLibsProp = New-Object 'System.Collections.Generic.Dictionary[String, String]'
$vcLibsProp.Add("Name", "Microsoft Visual C++ Runtime Package")
$group.AddItem("SDKReference", "Microsoft.VCLibs, version=11.0", $vcLibsProp)
$sqliteProp = New-Object 'System.Collections.Generic.Dictionary[String, String]'
$sqliteProp.Add("Name", "SQLite for Windows Runtime")
$group.AddItem("SDKReference", "SQLite.WinRT, Version=3.7.17", $sqliteProp)
This code works, but the references don't appears in the project. I see my own dll from my package but not the reference from VCLibs and SQLite.
By The Way, if I restart Visual Studio, my project show correctly the SDK references.
The only solution I have found to force refresh the Visual Studio References view is to add in my powershell script the line :
The problem here is the dialog box requesting "Do you want to refresh the project, because it has been modified ...."
Any suggestions ?
Thank you !
(Sorry for my poor English :) )