VSIX installer not compatible with VS2017 and VS2019 - visual-studio-2017

I'm using the following extension.vsixmanifest file to create my vsix package:
<?xml version="1.0" encoding="utf-8"?>
<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">
<Metadata>
<Identity Id="774e58ba-f1b9-40a7-b676-834fa2c220fe" Version="1.0" Language="en-US" Publisher="Me" />
<DisplayName>MyProduct</DisplayName>
<Description xml:space="preserve">Description of my product</Description>
<Icon>App.ico</Icon>
</Metadata>
<Installation AllUsers="true">
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[11.0, 17.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0, 17.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Enterprise" Version="[11.0, 17.0)"/>
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" Version="[4.5,)" />
</Dependencies>
</PackageManifest>
When I try to install targeting Visual Studio 2017 or Visual Studio 2019, I'm getting the following message:
Someone knows how could I address this issue?

You need <Prerequisites> section in the manifest:
At a minimum, all extensions should specify the Visual Studio core
editor component as a prerequisite.

Related

Specify architecture and Debug/Release modes in *nuspec file to publish a DLL C++ project

I have a Visual Studio C++ project that creates a DLL for both x86 and x64 architectures in Debug and Release modes. I should publish this package as a nuget package with regards to these specifications. So I should have 4 DLLs in my package. My question is how to specify x86, x64 in my nuspec file. I was thinking whether it should be specified in the target field of each file but I can't find any documentation on how to exactly specify these specifications.
My nuspec file looks like the following:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<!-- Required elements-->
<id>counterpartylookup</id>
<version>0.0.0</version>
<description>counterpartylookup/v140/win32/x86/x64</description>
<authors>***</authors>
<!-- Optional elements -->
<!-- ... -->
<owners>...</owners>
<licenseUrl>***</licenseUrl>
<projectUrl>***</projectUrl>
<dependencies>
***
</dependencies>
<tags> {vc140, win32, x64, x86, dynamic, C++, native}</tags>
</metadata>
<files>
<file src="..\shared\v140\bin\x64\Release\CounterPartyLookup.dll" target="lib" />
<file src="..\shared\v140\bin\x64\Debug\CounterPartyLookup.dll" target="lib" />
<file src="..\shared\v140\bin\x86\Release\CounterPartyLookup.dll" target="lib" />
<file src="..\shared\v140\bin\x86\Debug\CounterPartyLookup.dll" target="lib" />
</files>
<!-- Optional 'files' node -->
</package>
My question is how to specify x86, x64 in my nuspec file.
You need to place the dlls in a folder named runtimes within sub-folders named {platform}-{architecture}\lib{framework} or {platform}-{architecture}\native.
The folder structure:
\runtimes
\x86
\Debug
\Release
\x64
\Debug
\Release
The nuspec file is like:
<files>
<file src="..\shared\v140\bin\x64\Release\CounterPartyLookup.dll" target="runtimes\ x64\Release " />
<file src="..\shared\v140\bin\x64\Debug\CounterPartyLookup.dll" target=" runtimes\ x64\Debug " />
<file src="..\shared\v140\bin\x86\Release\CounterPartyLookup.dll" target=" runtimes\ x86\Release " />
<file src="..\shared\v140\bin\x86\Debug\CounterPartyLookup.dll" target=" runtimes\ x86\Debug " />
</files>
The related documents: Architecture-specific folders and Adding the native implementation libraries.
Or you could try another:
1) create a file called <package_id>.targets file in your project folder. In your side, you should name it as counterpartylookup.targets:
write these under it:
<Project>
<ItemGroup Condition="'$(Platform)'=='x64' and '$(Cofiguration)'=='Debug'">
<Reference Include="$(MSBuildThisFileDirectory)..\Reference\x64\Debug\CounterPartyLookup.dll"></Reference>
</ItemGroup>
<ItemGroup Condition="'$(Platform)'=='x86' and '$(Cofiguration)'=='Debug'">
<Reference Include="$(MSBuildThisFileDirectory)..\Reference\x86\Debug\CounterPartyLookup.dll"></Reference>
</ItemGroup>
<ItemGroup Condition="'$(Platform)'=='x64' and '$(Cofiguration)'=='Release'">
<Reference Include="$(MSBuildThisFileDirectory)..\Reference\x64\Release\CounterPartyLookup.dll"></Reference>
</ItemGroup>
<ItemGroup Condition="'$(Platform)'=='x86' and '$(Cofiguration)'=='Release'">
<Reference Include="$(MSBuildThisFileDirectory)..\Reference\x86\Release\CounterPartyLookup.dll"></Reference>
</ItemGroup>
</Project>
2) modify your nuspec file:
<files>
<file src="..\shared\v140\bin\x64\Release\CounterPartyLookup.dll" target="Reference\x64\Release" />
<file src="..\shared\v140\bin\x64\Debug\CounterPartyLookup.dll" target="Reference\x64\Debug" />
<file src="..\shared\v140\bin\x86\Release\CounterPartyLookup.dll" target="Reference\x86\Release" />
<file src="..\shared\v140\bin\x86\Debug\CounterPartyLookup.dll" target="Reference\x86\Debug" />
<file src="counterpartylookup.targets" target="build"/>
</files>
3) repack your c++ project and then before you install the new one, you should delete all nuget caches under C:\Users\xxx(current user)\.nuget\packages

Visual studio ignores AdditionalLibraryDirectories in props file

I'm trying to build the application that uses libzip.
I build the libzip library first and got zip.lib and zip.dll.
Now on the linking stage I get an error
Error LNK1104 cannot open file 'zip.lib'
It seems that AdditionalLibraryDirectories is ignores whereas AdditionalIncludeDirectories works well (all zip-related headers are found)
settings.props:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\libzip\lib;$(SolutionDir)\libzip\build;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(SolutionDir)\libzip\build\lib\Debug</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zip.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
If I add "$(SolutionDir)\libzip\build\lib\Debug\" to Additional library directories of the project, everything works! So the zip library is not corrupted.

Cannot use dotcover with VS2017 (tests are inconclusive)

I am able to run and debug my unit tests using ReSharper but when I try to use dotcover all tests show as inconclusive.
I'm using Visual Studio Enterprise 2017 (v15.9.4) with ReSharper Ultimate 2018.3, and sll the projects in my solution use .NET Framework 4.7.2.
My unit test project uses NUnit and has the following nuget packages installed:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Faker.Net" version="1.1.1" targetFramework="net472" />
<package id="FluentAssertions" version="5.5.3" targetFramework="net472" />
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net472" />
<package id="Microsoft.CodeCoverage" version="15.9.0" targetFramework="net472" />
<package id="Microsoft.NET.Test.Sdk" version="15.9.0" targetFramework="net472" />
<package id="NBuilder" version="6.0.0" targetFramework="net472" />
<package id="NUnit" version="3.11.0" targetFramework="net472" />
<package id="NUnit3TestAdapter" version="3.12.0" targetFramework="net472" />
<package id="RazorEngine" version="3.10.0" targetFramework="net472" />
</packages>
These are some of my settings related to tests:
Unit Testing (General)
Unit Testing (Test Runner)
Dotcover (General)
What I am missing here?

TruePlay interface

I tried to run TruePlay tutorial from https://msdn.microsoft.com/en-us/library/windows/desktop/mt808781(v=vs.85).aspx , but got an error :
"Unable to activate Windows Store app 'AppName'. The ProcessName
process started, but the activation request failed with error
'ErrorNumber'(it says "an error has been found in the system binary file, try to restore your PC)- translation from russian "
I used a new C++ UWP project in Visual Studio 2017
Also, when i change my Package.appxmanifest (like in tutorial from link above) and build the project this warning comes out:
https://i.stack.imgur.com/2gflN.png
File manifest:
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp rescap">
<Identity
Name="76f3b46c-58e3-422b-a2ee-c9d7dfd62e9b"
Publisher="CN=dana"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="76f3b46c-58e3-422b-a2ee-c9d7dfd62e9b" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>App6</DisplayName>
<PublisherDisplayName>dana</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="App6.App">
<uap:VisualElements
DisplayName="App6"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="App6"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="gameMonitor" />
<rescap:Capability Name="protectedApp" />
</Capabilities>
</Package>

Bootstrapper Prerequisites not showing up

I have a problem with Bootstrapper Prerequisites (with Bootstrapper Manifest Generator and doing it by hand...). I want to package Visual Power Packs 3.0 and Microsoft Sync 2.1 in one pack, so it appears in only one folder like (FinalApp_Prerequisites) along with the setup. The problem is that, only one of the 2 executables is detected, not both of them.
Here is my Product.xml
<?xml version="1.0" encoding="utf-8"?>
<Product ProductCode="FinalApp.Prerequisites" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
<PackageFiles CopyAllPackageFiles="true">
<PackageFile Name="synchronization-v2.1-x64-esn.msi" PublicKey="3082010A0282010100BD3089FB4572A8536B9E894F0023C0BED41D3DB1594038F373918226E696120053D91C820E3CCE1DBBBDF7428D97D4FC381AE4B9F9E3ECD36103BFA0D3D6754D5C46A9ED5EF0D2E2695B1A73EAB31C8D04CD2944A064592F1E985D6EC7AB18398265C4A7BCAB758819EA87971426B37F2676A4D4383984E3B326D518F92BE9D2C9165A5421F2978D878629FEF4492CE68BF8043F7DCDCD9692860D7103E2D0FE0C4235FFD7B83FDD8E450A7DF6D74BAD5BF076721D77237D8935C41C5DB250034B476D07A75588980680A681AD544ED881D6FABF42C031BE550D99D553491230EBE5A5887C5EC47A5A148708B43769A0EB32248C08EBF9D414BAE0FCCDEAA4150203010001" />
<PackageFile Name="visualbasicpowerpacks3setup.exe" PublicKey="3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001" />
</PackageFiles>
<Commands Reboot="Defer">
<Command PackageFile="synchronization-v2.1-x64-esn.msi">
<ExitCodes>
<DefaultExitCode Result="Fail" String="Anunexpectedexitcodewasr" FormatMessageFromSystem="true" />
</ExitCodes>
</Command>
<Command PackageFile="visualbasicpowerpacks3setup.exe">
<ExitCodes>
<DefaultExitCode Result="Fail" String="Anunexpectedexitcodewasr" FormatMessageFromSystem="true" />
</ExitCodes>
</Command>
</Commands>
</Product>
And here is my Package.xml
<?xml version="1.0" encoding="utf-8"?>
<Package Name="DisplayName" Culture="Culture" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
<Strings>
<String Name="Culture">en</String>
<String Name="DisplayName">FinalApp Prerequisites (Microsoft Synchronizer Framework 2.1 & Microsoft Visual Basic Power Packs 3.0)</String>
<String Name="Anunexpectedexitcodewasr">An unexpected exit code was returned from the installer. The installation failed.</String>
</Strings>
</Package>
What am I doing wrong? Or is it that I just can't put up 2 executables together as one prerequisite?
Both commands have a only a default exitcode which is fail. So when the bootstrapper runs, it will always detect the first installation to fail, so the second will not run any more. For example you can define that exitcode 0 means success:
<Command PackageFile="visualbasicpowerpacks3setup.exe">
<ExitCodes>
<ExitCode Value="0" Result="Success"/>
<DefaultExitCode Result="Fail" String="Anunexpectedexitcodewasr" FormatMessageFromSystem="true" />
</ExitCodes>
</Command>