Unable to use QT in Visual Studio 2017 - c++

I have installed 'qt-vsaddin-msvc2017-2.3.0' for using QT in Visual Studio 2017, but there are some issues after installation. First thing is that I can not modify QT project Settings in Qt VS Tools since it is grey. After I restart VS, it keeps showing that 'Qt Visual Studio Tools Version 2.3.2: initializing...' and doesn't go on. Is there something I miss when I install qt-vsaddin?

Answering this question a bit late because I ran into this problem myself today. The problem is your VS2017 is not up to date -- You need at least version 15.8; currently 15.9 is released. Odds are your ActivityLog.xml looks similar to Pavel Celba's answer here in which it's having trouble loading a specific version of the Microsoft.VisualStudio.Threading assembly. In order to fix the issue, you're going to have to do one of two things:
Update your Visual Studio Community/Professional/Enterprise to the latest version.
Downgrade your version of the Qt vsaddin to 2.2.2. You can obtain the 2.2.2 release, here. If you need a previous version because your version is even earlier, go to the parent directory of that link.
Once you've installed 2.2.2 or have obtained the Visual Studio 15.9 update, it should be working correctly.
I also had this issue because my VS version is 15.4 but I can't connect to the internet on that computer.

Try installing qt-vsaddin-msvc2017-2.3.2.vsix . If it fails you will probably need to reinstall VS 2017.

We have same problem here - the error shown is:
<entry>
<record>334</record>
<time>2019/02/25 12:48:44.893</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Vsix]Source: &apos;QtVsTools&apos; Description: Could not load file or assembly &apos;Microsoft.VisualStudio.Threading, Version=15.8.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly &apos;Microsoft.VisualStudio.Threading, Version=15.8.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.
File name: &apos;Microsoft.VisualStudio.Threading, Version=15.8.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos;
at QtVsTools.Vsix.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)
at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass16_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)
at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)
at Microsoft.VisualStudio.Services.VsTask.GetResult()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
</description>
<guid>{15021976-647E-4876-9040-2507AFDE45D2}</guid>
<hr>80070002</hr>
<errorinfo></errorinfo>
</entry>
Our Visual Studio version is:
Microsoft Visual Studio Enterprise 2017
Version 15.5.1
We cannot update to newest update due to company policies.

Disconnect form internet and install Qt vsaddin 2.2.2 then run VS2017 go to Tools>Extensions and Updates> select "Qt Visual Studio Tools" > and then uncheck "Automatically update this extension".

Related

VS 2017 Build Tools failing with Error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found

I'm building a new TFS build server and decided to use the VS 2017 Build Tools instead of installing the full versions of VS. When I attempt to build our C++ projects, it throws the following error:
Error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found.
After many hours of research I'm no closer to resolving this issue. I tried adding the following registry settings but it did not help.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath14"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath14)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\11.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\14.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath14"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath14)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
I'm guessing Microsoft's installer is broken for this product. Is there a standard fix for this error or should I scrap my efforts and simply install the full versions?
In the project file, I found this entry:
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
So, I guess this means that the variable VSTargetsPath is somehow pointing to the root of the D: drive but I haven't got a clue where that value is being set. Our current build server does not have an environment variable set named VSTargetsPath, but it does have the missing registry entries. It also has full versions of VS installed.
VS 2017 Build Tools failing with Error MSB4019: The imported project “D:\Microsoft.Cpp.Default.props” was not found
Try to pass VCTargetsPath explicitly as property to msbuild from your build configuration:
Edit the build definition for the build.
Click the process tab.
In the Advanced section, set the MSBuild Arguments to include the following property:
/p:VCTargetsPath="C:\Program Files (x86)\Microsoft Visual Studio\2017\xxx\Common7\IDE\VC\VCTargets\"
Save the build definition.
Note: You should change the value of VCTargetsPath to the location of the VCTargets folder.
Or pass VisualStudioVersion as property to msbuild:/p:VisualStudioVersion=15.0
If you are interesting in the value of $(VCTargetsPath), you can check following threads for some more details:
Can't find registry entries for Visual Studio 2017
Visual Studio Locator
Over the years Visual Studio could be discovered using registry keys,
but with recent changes to the deployment and extensibility models a
new method is needed to discover possibly more than once installed
instance. These changes facilitate a smaller, faster default install
complimented by on-demand install of other workloads and components.
vswhere is designed to be a redistributable, single-file executable
that can be used in build or deployment scripts to find where Visual
Studio - or other products in the Visual Studio family - is located.
For example, if you know the relative path to MSBuild, you can find
the root of the Visual Studio install and combine the paths to find
what you need.
You can emit different formats for information based on what your
scripts can consume, including plain text, JSON, and XML. Pull
requests may be accepted for other common formats as well.
vswhere is included with the installer as of Visual Studio 2017
version 15.2 and later, and can be found at the following location:
%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe.

Error loading visual studio 2015 C++ project, how to debug

I have a VS 2015 C++ project on a remote directory that I want to share between 2 computers. On one computer it loads fine (it has Microsoft Visual Studio Community 2015 Version 14.0.25431.01 Update 3 Microsoft .NET Framework Version 4.6.01055) on the other computer it fails to load (it also has Microsoft Visual Studio Community 2015 Version 14.0.25431.01 Update 3 Microsoft .NET Framework
Version 4.6.01055). When it fails to load I get the (not very informative message)
TargetImager.vcxproj: The application which this project type is based on
was not found. Please try this link for further information
[The link is completely useless!]
I opened the project file in the solution (can't remember how I managed to do this) and it presents a number of warnings eg.
Severity Code Description Project File Line Suppression State
Warning The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'PlatformToolSet' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Property, VisualStudioVersion, MinimumVisualStudioVersion, AdditionalFileItemNames, AllowUnsafeBlocks, AppConfigForCompiler, ApplicationIcon, ApplicationRevision, ApplicationVersion, AppDesignerFolder, AspNetConfiguration, AssemblyKeyContainerName, AssemblyKeyProviderName, AssemblyName, AssemblyOriginatorKeyFile, AssemblyOriginatorKeyFileType, AssemblyOriginatorKeyMode, AssemblyType, AutoGenerateBindingRedirects, AutorunEnabled, BaseAddress, BootstrapperComponentsLocation, BootstrapperComponentsUrl, BootstrapperEnabled, CharacterSet, CheckForOverflowUnderflow, CLRSupport, UseDebugLibraries, CodePage, Configuration, ConfigurationName, ConfigurationOverrideFile, CreateDesktopShortcut, CreateWebPageOnPublish, CurrentSolutionConfigurationContents, DebugSecurityZoneURL, DebugSymbols, DebugType, DefaultClientScript, DefaultHTMLPageLayout, DefaultTargetSchema, DefineConstants, DefineDebug, DefineTrace, DelaySign, DisableLangXtns, DisallowUrlActivation, CodeAnalysisAdditionalOptions, CodeAnalysisApplyLogFileXsl, .... Miscellaneous Files H:\CodeProjects\QTProjects\TargetImager\TargetImager.vcxproj 20
Here is the section of the project file XML
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<PlatformToolSet>v140</PlatformToolSet>
It doesn't like this PlatformToolSet setting for instance. I don't get it because it is a setting in the property pages on VS2015 that can be selected. I anyway changed this property clicked apply then changed it back clicked apply. It is still there in the project file as before with same error message, I also changed the setting to v140_xp just to verify that it was seeing the new property which it was.
The story is that I was working on one computer with VS 2015, then I wanted to run something on another remote computer, however by then VS 2015 was replaced with VS 2017 and I installed VS 2017 on the remote. I built the project on VS2017 but then went back to the local PC with VS2015 to do some QT stuff (QT plugin is not yet available on VS2017). This was OK but then it refused to load on the remote VS2017 PC. So I uninstalled VS2017 and replaced it with VS2015, the project still doesn't load on the remote PC with VS2015.
Maybe somehow I have a VS 2017 project that for some reason loads on one computer with VS2015 and not the other, hence the settings that VS 2015 doesn't like.
So I try to create a new QT GUI project (I installed QtVsTools extension) on the remote machine that has problems with my project file. And now I get an error (the same error also occurs with a new win32 console application)
.../TarImager.vcxproj cannot be opened because its project type (.vcxproj) is not
supported by this version of the application.
To open it please use a version of the project that supports it.
As far as I know .vcxproj has been supported since MS VS 2010
Any idea how I can debug this?
The visual studio install had become corrupted, I repaired the installation then was able to create projects again. If you get weird project loading errors, then maybe your VS install is messed up.

Could not load file or assembly 'Microsoft.VisualStudio.Tools.Applications.Core, Version=10.0.0.0

TLDR: Does anyone know what C++ Redist version and/or VSTA package I need that provides Applications.Core Version 10..? Assuming that is the actual issue.
We have an SSIS package running on Windows 2008 R2 and SQL Server 2008. VS C++ Redist 2005, 2008 and 2010 installed... as well as VSTA 2.0 ENU.
Migrating everything to a new server, Windows 2012 R2 and SQL Server 2014.
I've installed VS C++ Redist 2013, 2015... as well as VSTA 2015.
When the SSIS package is run from the new server, it almost immediately throws the following exception.
There was an exception while loading Script Task from XML:
System.IO.FileNotFoundException: Could not load file or assembly
'Microsoft.VisualStudio.Tools.Applications.Core, Version=10.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified. File name:
'Microsoft.VisualStudio.Tools.Applications.Core, Version=10.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Now I'm sure I could go and install every old C++ Redist out there, and the old VSTA versions as well, then once it starts working uninstall all the others. But I would prefer not to make a mess on this server by installing and uninstalling tons of unnecessary stuff... leaving behind bits and pieces of software.
In the Job Step Properties => General (tab) => Execution Options (tab). . . . there is a "Use 32 bit runtime" option that is not checked. Checking it and re-running my process has no effect.
I found Easy Solution as below,
Go to Solution Explorer --> Right Click Solution -->Property
Change Run64BitRunTime=False
It works for me.
Click for image of Solution Explorer-->Change to 32Bit
This could help, did you try it?
http://pietervanhove.azurewebsites.net/?p=461
EDIT - from the link above:
To overcome the issue just install the Installation of SQL Server Data Tools and Integration Services at the same time.
The SQL Server Installation Wizard detects that it still has to install the Microsoft Visual Studio Tools for Applications 3.0
Both x64 and x86 Tools are installed than.

Unable to create/open C++ project in Visual Studio 2015 Community RTM

Before installation of RTM version of VS2015 Community Edition I had uninstalled VS2015 Enterprise CTP6 (including applications from "second installer"). There wasn't any problem during installation, but now I'm unable to create/open any C++ project. I receive following error message:
C:\Users\Piotrek\Documents\Visual Studio 14\Projects\Tests\Tests\Tests.vcxproj : error : Method not found: 'System.Threading.Tasks.Task Microsoft.VisualStudio.Project.IVsUnconfiguredProjectTypeGuidSetter.SetActiveProjectConfigurationAsync(Microsoft.VisualStudio.ProjectSystem.ProjectConfiguration, Microsoft.VisualStudio.ProjectSystem.ProjectConfiguration)'.
I tried to reinstall all related to any VS version stuff, but the problem remains.
Unfortunately, Google knows nothing about SetActiveProjectConfigurationAsync and now I'm stuck. Any suggestions?
Check if the Microsoft.VisualStudio.ProjectSystem.v14only.dll assembly is in your GAC (you'll see a similarly-named folder under C:\Windows\Microsoft.NET\assembly\GAC_MSIL if it is). It shouldn't be there. But perhaps you have an old version of that assembly in your GAC. If you see any folders in your GAC starting with Microsoft.VisualStudio.ProjectSystem.*, move them to a temporary folder and see if it fixes your problem. If it does, delete your temporary folder.

Can't debug using VS2005 on Win7/64 box

I've got an 32-bit C++ app, "MyOldApp" built with VS2005. I recently changed my dev PC from a WinXP box to a Win7/64 one. On it I installed VS2005,VS2008,VS2010 and VS2012 (in that order).
Then I found I could not launch "MyOldApp" inside VS2005 in the Debug configuation (Release works fine). Error: Unable to start program. This application has failed to start because the application configuration is correct." Windows event log says: Activation context generation failed for "MyOldApp.exe". Dependent Assembly Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762" could not be found. Please use sxstrace.exe for detailed diagnosis.
I check the manifest and it confirms this dependency.
So I check C:\Windows\winsxs and find this directory: x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.42_none_ef74ff32550b5bf0
Then I check VS2005 Help > About, find it at 8.0.50727.42 and realize I never installed SP1 which I must have been using on the XP box. So I set out to update my machine from .42 to .762 but fail. I have tried installing it from here:
Visual C++ 2005 Sp1 Runtime (x86)
and from here:
Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Update
While installing, I get and agree to the license agreement, then see the "preparing to install" dialog. Then the installer just silently exits, and I am left with version .42 and my original problem.
How do I get SP1 to install? Thanks.
Found this:
Microsoft® Visual Studio® 2005 Team Suite Service Pack 1
and it was kind enough to run to completion. Launched VS2005 and it told me to do another update, which I found here:
Visual Studio 2005 Service Pack 1 Update for Windows Vista
which also ran to completion. VS2005 Help about now shows version .762 and my app can be run in Debug Configuration.