What is the default target framework of VS2017 - visual-studio-2017

How can i find the default target frame work of the VisualStudio 2017.
I need to create the csproj and solution file for VS2017 manually.
The following screenshot shows the default target framework for VS2013.

I think by default (when you create a new csproj in VS2017) the TargetFramework is set to netstandard1.4

I have installed and checked with the VS2017. It has create the default project frame work as 4.5.2.
Regards,
Adhi

Related

Visual Studio with Qt VS Tools Throws "Object reference not set to an instance of an object" When Opening Qt Project File

Hi I have a hopefully simple issue. When I try to open an existing Qt project file in Visual Studio 2019 by going to Extensions -> Qt VS Tools -> Open Qt Project File then selecting the project I get the error message "Object reference not set to an instance of an object". I have set the Qt version properly I think as in the screenshot. Any idea what might be wrong? There is a bin folder in the Qt install folder which contains qmake.exe and everything else but using that folder doesn't fix anything. One possibly important detail is that the Qt project points to files located on a mapped drive for a network share. Qt Creator opens the project just fine. Thanks!
finally I found the solution:
open the project settings file yourproject.vcxprj with a test editor
find the property group "globals"
<PropertyGroup Label="Globals">
<ProjectGuid>{AAAA-AAA-AAAAA-AAAA}</ProjectGuid>
<Keyword>QtVS_v302</Keyword>
Change the Keyword property to "QtVS_v302" as above.
Open the solution with Visual Studio and now QT Tools should work
In my case keywork was "Qt4VSv1.0" that probably was the setting of an old version of QT Tools that now is obsolete.
I wanted to post this as a comment rather than another answer, but the reputation system blocked me.
Mattia's answer solved the issue for me but I needed to use QtVS_v304 rather than QtVS_v302. It seems that Qt has created another project format.

Configure QtPackage for Visual Studio by command line

I'm trying to build a project which uses qt on an CI service for windows.
I already managed to install the QtPackage for Visual Studio by command line.
Now I'm stuck at the following step:
Launch VS2015 for configuring Qt5Package
QT5 > Qt Options > Add
Version name: Qt 5.6.22Win32
Path: C:\build\libs\qt5_6_2\qtbase
Default Qt/Win version: Qt 5.6.2 Win32 – OK - You may need to restart Visual Studio for this to take effect.
Is is possible to do this from the command line? If not, how can I work around this problem?
If you are willing to modify such global setting (for all projects), I'm sorry but there is no way to do it from command line in current public versions of the QtVSTools, nor in the latest version from the repository head (https://code.qt.io/cgit/qt-labs/vstools.git/ # 2018-01-09).
On the other hand, if you use msbuild to compile the project, you can override the Qt version to be used during that compilation (project files are not modified).
To do so, change the QTDIR project property (using the /property option) and indicate the path to the directory of Qt version you want to use:
msbuild your_solution.sln /property:QTDIR="C:\build\libs\qt5_6_2\qtbase"
Hope this helps.

Qt 5.6 VS 2015 Add-in asks to specify default version

My story starts same as here Qt 5.6 VS 2015 problem
I have installed this
http://download.qt.io/development_releases/qt/5.6/5.6.0-beta/qt-opensource-windows-x86-msvc2015-5.6.0-beta.exe.mirrorlist
And tried it using this extension on VS
https://visualstudiogallery.msdn.microsoft.com/c89ff880-8509-47a4-a262-e4fa07168408
I've faced the same problem as described in that question. And the answer solved my problem as well.
But now I have another error. I've searched on the net but couldn't find anything related to. By now, QT path in Qt Add-in is set. Every time I click 'Open .pro project' it tells me
The following error occurred:
The default Qt version does not support Visual Studio 2015.
In order to import .pro files specify a Qt version >=5.2 as default.
So, the question is how to specify a Qt version. Probably it's one line in a config file, but in which one?

Visual C++ 2010 Express using wrong toolset

My project has Project > Properties > General > Platform Toolset set to v100, however when I try to build I get
Microsoft.Cpp.Win32.Targets(511,5): error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.
I have searched the project file for v110 and it is not in the file. I am coming from Linux and this Visual Studio stuff is being a big headache.
Is there another setting somewhere that I may be missing?
Edit:
I am getting this message when opening the project.
C:\Users\Ryan\Downloads\CRYENGINE_Build_PC_v3_5_8_2310_freesdk\Code\CryEngine\CryAction\CryActionHeaders.vcxproj : warning : Platform 'x64' referenced in the project file 'CryAction' cannot be found. Please make sure you have it installed under '%VCTargetsPath%\Platforms\x64'.
Edit2:
I think I have found the problem. The $(PlatformToolset) macro is v110, im just not sure how to edit it yet.
I had a similar problem a long time ago. I concluded it was probably due to a bug in VS. I 'solved' it by creating a new project, and importing everything again.
Check that you build the same project configuration as you are looking at.
At the top of the General page there are Configuration > Debug/Release and Platform (can be Win32/x64) comboboxes. Toolset setting can be different for each project configuration.
Open .vcproj in a text application (Notepad++), then find all instances of that declare the version.
Anything labeled v1xx or that has the word version in the tag (ie ) will be what needs to be changed to some form representative of the target version you are using.
If it has something like v141 and you want VS10 then it needs to be changed to v101.
Hope that helps.

"There's no Qt version assigned to this project for platform Win32" - visual studio plugin for Qt

I have a Qt project I am working on in Visual Studio 2010, with the Qt Visual Studio Add-in (for Qt 4.8). The project is running fine on my work machine, and I am trying to run it on my home machine. When I try to build, I get the following error:
There's no Qt version assigned to this project for platform Win32.
Please use the 'change Qt version' feature and choose a valid Qt
version for this platform.
However, it's set up to use a valid Qt version (another project I'm working on at home uses this plugin as well). Why is this occurring? When I got to Qt -> Qt Options, I see a valid version (4.8.0). Thanks
Did you select a proper Qt version in the Qt settings of your project?
More detailed:
If you right-click on the project there should be a "Qt Project Settings" option (or similar - I use the german version) near the end of the context menu. In there you can set the Qt version that this specific project uses. Is this one possibly not set correctly?
Solution:
Right click your project;
Qt Project Settings;
Under the Properties tab, you will find the option Version;
change it to a proper value;
Now, go ahead with your project.
Hope to help
Had the same problem with a x64 Visual Studio 2019 solution on Windows using Qt 5.15.0. Based on the answer from #Fabian and the excellent comment from #sitting-duck:
Install the Qt VS Tools extension
Select Extensions > Qt VS Tools > Qt Options
On the Qt Versions tab click Add
Set "Version Name" to something like "Qt-5.15.0"
Set "Path" to "[QT-PATH]\5.15.0\msvc2019_64"
Open Project Properties > Qt Project Settings > General > Qt Installation
Ensure this is set to "Qt-5.15.0" and close Project Properties
Right-click the solution (in the Solution Explorer tab) and select Change Solution's Qt Version
Ensure Qt-5.15.0 is selected
You should be good to go.
Open vcxproj file in a notepad, look for QtVersion...something=...
Ensure that the version value is really 4.8.0 (or whatever is your actual QT SDK version).
I found this issue too. and I found the solution .
you must keep the Qt version name is exactly same with the project create using.
which you think u can change freely,but actually not.
If you want to move Qt project between different computers, it's a good idea to use the qt project file, and not the MSVC (.vcxproj) one. So when you move from your work machine home, create a .pro file (in the Qt menu, you find the neccessary options to do that), and then load the .pro file at home, again using the Qt menu inside MSVC.
Another thing this could be is the platform being used is not the platform you think it is. In MSVC right-click on project, select properties, and then press configuration manager. Then check that all configurations and platforms are as you expect them to be.
I got the same problem during migration from Qt5.9 to Qt5.10.
We have a solution (Visual Studio) which consists of many projects. Some of them have QtVersion = "Qt5.9" and others have QtVersion = "Qt5.7" (yes, it were inaccurate project settings)
So, after I change all Qt project's settings from 5.9 to 5.10 automatically and remove Qt5.7 from versions list - I got the same error. This error was fixed trivially - I just add back Qt5.7 to the versions list (temporary until ALL projects' Qt version was not changed to 5.10).
In my case, I ported a Visual Studio project, with all its files (including .sln, .vcxproj, etc) to another computer using git. When I set everything up on the new computer, I accidentally selected a different folder for the Qt executables in VS (I selected C:\Qt\5.9.9\winrt_x86_msvc2017 instead of C:\Qt\5.9.9\msvc2017_64). When I double-checked which I had selected on the original computer, and then selected the same on the new computer, all was good.
To select a Qt folder: Extensions -> Qt VS Tools -> Qt Options -> Add -> Path (Version Name is auto-filled once you select the path).
This all describes the process using Visual Studio 2019, with the Qt plugin found here.
You could follow AlainD's instruction.
It work for me.
Just Right-click on Solution -> Change Solution's Qt Version
It will make change for its all projects.