Visual Studio 2015 doesn't load after PC restart - c++

I have been using VS2015 professional for about a year now but I had a power failure on my PC and after restarting VS2015 fails to run.
The startup logo appears for about a second and then disappears.
On the command line:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>devenv /setup
Package 'Async Query Service Package' failed to load.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>
The problem seems to be Async Query Service Package.
In the activitylog.xml file I see error:
<entry>
<record>5</record>
<time>2018/03/01 14:48:06.133</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Async Query Service Package]Source: &apos;Microsoft.VisualStudio.Shell.14.0&apos; Description: Could not load file or assembly &apos;WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&apos; or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly &apos;WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&apos; or one of its dependencies. The system cannot find the file specified.
File name: &apos;WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&apos;
at Microsoft.VisualStudio.Shell.ThreadHelper.SetUIThread()
at Microsoft.VisualStudio.Shell.ServiceProvider.CreateFromSetSite(IServiceProvider sp)
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)
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>{DD7B74B5-C1F9-411A-B22E-5E711592BC6B}</guid>
<hr>80070002</hr>
</entry>
Do I need the Async Query Service Package? how can I disable it I don't believe I need it.
I only need the C++ language.
I followed pretty much all the advice in this post:
Packages not loading after installing visual studio 2015 RTM
But the basic uninstall and re-install doesn't fix the issue.
What can I do to fix this issue?

Related

Unreal Engine 4 Basic C++ Code Project giving compile error

I have been having this a problem when loading up a "Basic C++ Code Project" and have had absolutely no success due to lack of information.
The error is as follows:
Running E:/Program Files/Epic Games/UE_4.22/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Win64 -Project="D:/[My-User]/Documents/Code/[Project Root Dir]/[Project]/[Project].uproject" -TargetType=Editor -Progress -NoHotReloadFromIDE
Creating makefile for [Project]Editor (no existing makefile)
#progress push 5%
Parsing headers for [Project]Editor
Running UnrealHeaderTool "D:\[My-User]\Documents\Code\[Project Root Dir]\[Project]\[Project].uproject" "D:\[My-User]\Documents\Code\[Project Root Dir]\[Project]\Intermediate\Build\Win64\[Project]Editor\Development\[Project]Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for [Project]Editor in 8.2032876 seconds
#progress pop
Using Visual Studio 2017 14.16.27023 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
ERROR: System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at UnrealBuildTool.XGE.ExecuteTaskFile(String TaskFilePath, DataReceivedEventHandler OutputEventHandler, Int32 ActionCount) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Executors\XGE.cs:line 493
If there is any more information relating to this problem I am happy to provide it.
There could be something wrong with your installation of visual studio. Check your Visual Studio installer and ensure that the Game development with C++ workload is ticked. I typically also install the .NET Framework 4.6.2 SDK and targeting pack under the individual components list.
In your case it seems to be looking for Visual Studio 2017, so try the steps above with 2017 first.
I had similar problem after my pc shutdown
after backing up everything I removed all folders except source, content and config than generated virtual studio files using .uproject
problem solved :)
I figured out the issue. It didn't like using UE 4.22.3 for some reason...
Thanks for the help guys!

Unable to use QT in Visual Studio 2017

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".

Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=13.100.0.0

I am attempting to run a build in TFS 2018. We also have SQL Server 2016 installed on the TFS build server (which is Windows Server 2016). Visual Studio is 2017. The first solution file produces the following error, and I have no idea from where this file is referenced:
2019-01-22T20:35:26.8607312Z Package:
2019-01-22T20:35:26.8608029Z Invoking Web Deploy to generate the package with the following settings:
2019-01-22T20:35:26.8608667Z $(LocalIisVersion) is 10
2019-01-22T20:35:26.8609527Z $(DestinationIisVersion) is 10
2019-01-22T20:35:26.8610846Z $(UseIis) is True
2019-01-22T20:35:26.8612479Z $(IisUrl) is http://localhost:62327/
2019-01-22T20:35:26.8614266Z $(IncludeIisSettings) is False
2019-01-22T20:35:26.8615630Z $(_DeploymentUseIis) is False
2019-01-22T20:35:26.8617245Z $(DestinationUseIis) is False
2019-01-22T20:35:26.8666548Z GenerateMsdeployManifestFiles:
2019-01-22T20:35:26.8684620Z Generate source manifest file for Web Deploy package/publish ...
2019-01-22T20:35:27.0589951Z Visual Studio is 2017. ##[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Web\Deploy\Microsoft.Web.Publishing.MSDeploy.Common.targets(119,5): Error MSB4018: The "SqlScriptPreprocessSqlVariables" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=13.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SqlServer.BatchParser, Version=13.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
at Microsoft.Web.Publishing.Tasks.SqlScriptPreprocessor.SqlScriptPreprocessSqlVariables.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
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].
Found the same workaround that Michiel referred to.
My situation:
Visual Studio 2017 Build Tools (no IDE)
Microsoft.SqlServer.BatchParser Version=13.100.0.0 not registered in
the Global Assembly Cache. Neither was 13.0.0.0.
VS Build Tools does not include Microsoft.SqlServer.BatchParser.dll. The path referenced is for VS Enterprise and does not exist for Build Tools: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\SQLCommon\130. There is no similar path under C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
I checked install of Build Tools. Said that SQL Server Data Tools was installed - under Data Storage and Processing workload
My solution:
Per recommendation here, I downloaded and installed SQL Server Data Tools followed by a reboot.
That got Microsoft.SqlServer.BatchParser Version=13.0.0.0 registered in the Global Assembly Cache
Then, per workaround in question (developercommunity above), I added a binding redirect for MSBuild (in C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\BinMSBuild.exe.config - see below)
Fixed.
<!-- Workaround for errorMSB4018: The "SqlScriptPreprocessSqlVariables" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=13.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. -->
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.BatchParser" culture="neutral" publicKeyToken="89845dcd8080cc91" />
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="13.0.0.0"/>
</dependentAssembly>
Found a workaround here, for the desktop build. Did not try the TFS team build.
Use gacutil to register Microsoft.SqlServer.BatchParser v2015.130.1601.5 installed with Visual Studio 2017, apparently satisfying build task SqlScriptPreprocessSqlVariables even if it requested v13.100.0.0.
In:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\SQLCommon\130
or similar issue:
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\gacutil.exe" /i Microsoft.SqlServer.BatchParser.dll
or similar.
2023-02-14 The issue occurred again, now using Visual Studio 2022. The following workaround fixed the issue.
VS2022 now runs in 64 bit. Microsoft.SqlServer.BatchParser.dll built for 64 bit should be used. Also adding assemblies to the GAC is now discouraged. Instead copy the assembly from the installation location of VS2022, for example:
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\Microsoft\SQLCommon\150
to the correct MSBuild folder. Several MSBuild folders may be around, use the 64 bit folder actually used by VS2022, for example:
C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64
Build task SqlScriptPreprocessor.SqlScriptPreprocessSqlVariables resides in assembly Microsoft.Web.Publishing.Tasks.dll. That assembly asks for version 13.100.0.0 of Microsoft.SqlServer.BatchParser.dll. Version 13.100.0.0 cannot be used; it results in "Invalid assembly platform or ContentType in file". Instead add an assembly redirect for MSBuild. In for example:
C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\MSBuild.exe.config
add
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.BatchParser" culture="neutral" publicKeyToken="89845dcd8080cc91" />
<bindingRedirect oldVersion="0.0.0.0-999.999.999.999" newVersion="15.100.0.0" />
</dependentAssembly>
15.100.0.0 being the assembly version of Microsoft.SqlServer.BatchParser.dll; ignore any file version such as 2018.150.1000.16.

All Unit Test projects in TeamCity does not compile failing to reference Microsoft.VisualStudio.QualityTools.UnitTestFramework

All our unit test projects (About 8 of them) just stopped compiling and I can't find any good reason for it.
"error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)"
From the TeamCity (v2017.2.2) build log the projects are missing the Microsoft.VisualStudio.QualityTools.UnitTestFramework DLL with error codes CS0234 and CS0246. I can't see any code changes that could have caused it
there was however a server restart that might have kicked in some pending changes.
What has been checked
Checked both with a Visual Studio (SLN) and MSBuild runner step, both gave the same results (MSBuild was previously working fine while the Visual Studio was failing on the C# 6/7 code, the reason why we changed to a newer MSBuild version)
These Test projects build fine on the same build server if the solution is opened in Visual Studio 2017 Enterprise (Installed on Build server)
Project Reference configuration
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
MSBuild Version
We use the MSbuild v15.6.82.30579 in Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin not the default one in C:\Windows\Microsoft.NET\Framework64\v4.0.30319 (Added as such to environmental variables)
Any recommendations will be appreciated. I really don't want to start adding DLL's to the GAC if it can be helped.
If you are using Build Tools 2017 on your server, and you don't have Visual Studio 2017 installed, then you have to switch to MS Test v2:
https://blogs.msdn.microsoft.com/devops/2017/09/01/upgrade-to-mstest-v2/
https://www.nuget.org/packages/MSTest.TestAdapter
https://www.nuget.org/packages/MSTest.TestFramework
Old MS Test framework is not supported with Build Tools.
Then in TeamCity in Build Step you have to change your runner type to Visual Studio Tests, Test engine type from MSTest to VSTest, and Test engine Version to VSTest 2017
Install "VC++ 2017 version 15.7 v14.14 toolset" component under individual components, seems that the default toolset does not have the unit test binaries.
References:
Unit test files not installed by Visual Studio Build Tools 2017
Okay so the issue seemed to be broader than just Unit Tests. In short even though MSbuild and Visual Studio build (from the build server) running MSBuild step from Visual Studio does not utilize the same 'shared' folders.
I had to make use of a couple of different strategies to sort out version and missing common DLL's:
Update the Visual Studio Build Tools to the latest version i.e. get the latest version of MSBuild to the build server and ensure it is added to the OS environmental PATH (Set the default MSBuild to be the new one). In my case it was changing it from 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319' to 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin'
Add the missing/newer DLL to the MSBuild BIN folder and mark it as read-only so that it is not overridden again
As last resort you add the DLL to the GAC using the gacutil.exe. This is not recommended because it obfuscates the relationship (Rather try to find where it is used with Fusion logging and add it there).

Visual Studio 2015 Installation issues

I am working on some very old software that uses Visual Studio 6, Visual Studio .net and Visual Studio 2010. So I ended up having to install various versions of studio from 6 all the way to 2017. At some point something got messed up and I ended up uninstalling and reinstalling a whole bunch of things. Everything else works now, but Visual Studio 2015 is toast. I uninstalled anything related to 2015, then reinstalled it. Same problem. Uninstalled it again, hoping the uninstaller would correctly remove stuff, reinstall, again no go.
So, when I open VS, the log in button on the top right does nothing. If I try to create a test C++ project, it just closes the screen where you enter the project details and then reopens it, no joy there. If I open a solution with C++ projects in it is says it does not know how to load the project file of that type.
If I build the project in VS 2017 and leave the projects as VS 2015, I get a linker error "LINK : fatal error LNK1104: cannot open file 'mfc140d.lib'", so something mostly likely did not install properly.
After clicking on the log in button, the other menu's will highlight when you click on then, but no menu's.
The ActivityLog.xml contains stuff like this:
<entry>
<record>366</record>
<time>2017/08/08 14:18:48.820</time>
<type>Error</type>
<source>Extension Manager</source>
<description>Error loading extension: This VSIX does not apply to any product installed on this machine. The problem could be that the VSIX manifest&apos;s format is not recognized, or that the manifest has been corrupted. Data at the root level is invalid. Line 1, position 1. </description>
<path>C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\MICROSOFT\VSGRAPHICS\</path>
</entry>
<entry>
<record>367</record>
<time>2017/08/08 14:18:49.123</time>
<type>Error</type>
<source>Extension Manager</source>
<description>Extension will not be loaded because an extension with the same ID &apos;Microsoft.Windows.DevelopmentKit.Desktop&apos; is already loaded at C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\10\DESKTOP SDK\...</description>
<path>C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\8.1\DESKTOP SDK\</path>
</entry>
<entry>
<record>368</record>
<time>2017/08/08 14:18:49.123</time>
<type>Error</type>
<source>Extension Manager</source>
<description>Extension will not be loaded because an extension with the same ID &apos;Microsoft.Windows.DevelopmentKit.WindowsStore&apos; is already loaded at C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\10\WINDOWS STORE SDK\...</description>
<path>C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\8.1\WINDOWS STORE SDK\</path>
</entry>
I am guessing I might have to uninstall VS 2015 and then manually clean up any remnants? Any suggestions? I really don't want to rebuild this machine.
Thanks.
I know it isn't a helpful answer, but the error messages suggest your registry etc. is beyond repair. The fastest and safest way to clean up is formatting the disks and reinstalling Windows from scratch.
For your next attempt to use Visual Studio I strongly recommend virtual machines, one for each VS version.