GetService method of Package is returning null in vs2017 extension - visual-studio-2017

I am creating a visual studio 2017 extension in C# for pending changes. I got reference from here.
I am trying to get the instance via GetService method.
But everytime I am getting teamExplorer as null.
Microsoft.TeamFoundation.Controls.ITeamExplorer teamExplorer;
teamExplorer = base.GetService(typeof(Microsoft.TeamFoundation.Controls.ITeamExplorer))
as Microsoft.TeamFoundation.Controls.ITeamExplorer;
Can someone please help me in this ? How can I get the instance?

I am trying to get the instance via GetService method. But everytime
I am getting teamExplorer as null.
The method is too old you cannot get what you want by using GetService() method. You can try my steps to realize it which l have tested successfully.
1) Reference the Microsoft.TeamFoundation.Controls.dll under the path C:\Program Files (x86)\Microsoft Visual Studio\2017\xxxxx\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer.
Note: you should reference the related DLL in this folder and these APIs are for Visual Studio 2017.
2) change to use these codes:
Microsoft.TeamFoundation.Controls.ITeamExplorer teamExplorer;
teamExplorer= Package.GetGlobalService(typeof(Microsoft.TeamFoundation.Controls.ITeamExplorer))
as Microsoft.TeamFoundation.Controls.ITeamExplorer;
Hope it could help you.

Related

Error compiling Unreal Engine 4.24.1 after updating visual studio 2019

I'm having a weird error after updating Visual Studio 2019 Community from v16.4.5 to 16.5. Even a fresh install of the engine will no longer build. I'm getting the errors listed below. The build doesn't fail until the end of compiling all modules:
Error C4800 Implicit conversion from 'ADODB::_Recordset *const ' to bool. Possible information loss UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h 311
Error C4800 Implicit conversion from 'ADODB::_Connection *const ' to bool. Possible information loss UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h 311
Error MSB3075 The command "..\..\Build\BatchFiles\Build.bat -Target="UE4Editor Win64 Development" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command. UE4 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 44
I have not changed or updated anything on the Unreal Engine-side of the code. This error occurs during a build of UE4.sln, sourced from Epic's github repo. The build doesn't fail until all modules are built (it fails at the end of the build).
Seeing as Microsoft doesn't have archives of installers for VS Community, only Enterprise and Pro, I'm kind of suddenly stuck here because I can't just uninstall 16.5 and reinstall 16.4.5 (which is the last working version I was on before the update).
I heard sometimes setting "treat warnings as errors" to false can help, but I don't see a way to do that in Visual Studio.
Any insight into this would be helpful, Thanks!
So, turns out something changed on VS2019's side in the update from 16.4.5 to 16.5, but the fix for UE4 can be found in this commit on the 4.25 branch. Confirmed that this solved my problem!
First Make a backup of your whole project (just copy it to somewhere else).
Afterwards delete the following folders in the project directory:-
.vs
Intermediate
Saved
you just need to delete the .vs folder to solve the problem. The rest are just for a quick refresh of your project.
Next open Unreal Engine 4, then under File tab click on Refresh Visual Studio Project. On completion try to compile again. This should solve your problem.
For those who facing the same problem, here is the solution.
Step 1:
open the file ADOSupport.cpp on [YourEngineSourceDir]\Engine\Plugins\Runtime\Database\ADOSupport\Source\ADOSupport\Private
Step 2:
go to line 255 and modify it
from if(ADORecordSet && (ADORecordSet->State & ADODB::adStateOpen))
to if(ADORecordSet != nullptr && (ADORecordSet->State & ADODB::adStateOpen))
Step 3:
got to line 328 and modify it from if( DataBaseConnection && (DataBaseConnection->State & ADODB::adStateOpen)) to if( DataBaseConnection != nullptr && (DataBaseConnection->State & ADODB::adStateOpen))
Step 4: Build the solution and enjoy!
You should add the new line of code, like on the video tutorial:
Arguments.Add("/wd4800"); // 4800: Implicit conversion from 'type' to bool. Possible information
https://youtu.be/KXIv4y51fyw
That fix me that issue.
I had the same issue, and this solved it:
File Path
YOURENGINEPASS\Engine\Source\Programs\UnrealBuildTool\Platform\Windows
File to change
VCToolChain.cs
After line 456 add the following line:
Arguments.Add("/wd4800"); // 4800: Implicit conversion from 'type' to bool. Possible information

why I can not create a VC++ empty project on my windows using vs 2015 ,vs2017,vs2019

in VS 2015, there is a warning dialog 'null' is null or is not object when i try to create a VC++ project:
then i get another warning:
error from HRESULT:800A138F
in VS 2019 i got the warning:
Object reference not set to an instance of an object,
You could try steps below to resolve this issue:
1.Windows+R and enter regedit to open Registry Editor, make sure the value data of Enabled key is set to zero.
We can find the key here:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy
2.Restart VS to check if the issue goes away, if it persists, close all vs instances and delete all folders under path: C:\Users\xxx\AppData\Local\Microsoft\VisualStudio . It will clean all VS cache to reset the VS settings.
Note: AppData is a hidden folder.

Visual studio 2017 unable to update, installer uninstall with error log

I'm facing as issue where i can not do anything with my VS 2017 installer, it happened that I tried to updated via auto update but it was unsuccessful then , i close the program then reopen it again, but now it wont be able to do anything, i try to use clean up tool from Github but still fail.. follow the MS instruction but also fail
https://learn.microsoft.com/en-us/visualstudio/install/troubleshooting-installation-issues
Below is my error log
[0914:0009][2017-08-30T14:59:35] Error 0x80070057: at
Microsoft.VisualStudio.Setup.Dependencies.DependencyManager.BuildGraphCore(IPackage
root, IEnumerable`1 packages, DependencyComparer comparer,
Dictionary`2 packageIndex, Dictionary`2 nodeIndex, Boolean splitNodes,
DependencyCollection deprecated) at
Microsoft.VisualStudio.Setup.Dependencies.DependencyManager.BuildGraph(IPackage
root, IEnumerable`1 packages, Boolean isUpdate,
IDependencyComparisonSeed seed, DependencyCollection deprecated) at
Microsoft.VisualStudio.Setup.Engine.GetDependencyGraph(Product
product) at Microsoft.VisualStudio.Setup.Engine.PreChecks(String
installationPath, Boolean isLayoutSet, Product product, ExecuteAction
bootstrapperAction, ITelemetryOperation operation, IQuery query) at
Microsoft.VisualStudio.Setup.Engine.Uninstall(CancellationToken
token)The root node
"Microsoft.VisualStudio.Product.Community,version=15.0.26430.16" is
not in the package collection. Parameter name: root`
Thank you so much in advance for every answer, really appreciate all help,
best regards
The error for 0x80070057 in the OS Header files is:
An argument does not meet the contract of the method.
DDERR_INVALIDPARAMS ddraw.h
DIERR_INVALIDPARAM dinput.h
DPERR_INVALIDPARAM dplay.h
DPERR_INVALIDPARAMS dplay.h
DPNERR_INVALIDPARAM dplay8.h
DSERR_INVALIDPARAM dsound.h
DVERR_INVALIDPARAM dvoice.h
ecInvalidParam ec.h
ecInvalidSession ec.h
ecBadBuffer ec.h
MAPI_E_INVALID_PARAMETER mapicode.h
STIERR_INVALID_PARAM stierr.h
E_INVALIDARG winerror.h
Some problem with an invalid parameter. Based on this try and do a /ResetSettings (devenv.exe)
DevEnv /ResetSettings
https://msdn.microsoft.com/en-us/library/ms241273.aspx
Failing that you should:
Uninstall VS2017.
Use a tool called MSIZap/msicuu2 to remove any left overs.
Reinstall.
Failing that you have little choice but to rebuild your PC.
Troubleshooting Visual Studio 2017 installation and upgrade issues
See this link

Migration from vtk5 to vtk7-> missing CopyIndormation from vtkPolyData

I am trying to migrate a program from vtk5.10 to vtk7.0 (QT 5.7, Visual Studio 2013). I have managed to do the proper changes in some functions. Although, now I get an error on a removed function (in vtk6) the CopyInformation.
newOutput->CopyInformation(mapper->GetInput());
Is there any other fuction that could substitute this one in vtk7.0? I have searched on the vtk6 migration guides, but I couldn't find any helpful information (for substitution). I am new in vtk, so any advice could help.
Thank you.

Visual Studio 2015: C++ code analysis error C1253, unable to load model file 'res://mspft140.dll/300'

Visual Studio 2015 Community update 3, trying the C++ code analysis feature. The settings are as follows:
solution properties > code analysis settings > [all configurations] [all platforms] : microsoft native recommended settings
project properties > code analysis > [all configurations] [all platforms] : microsoft native recommended settings
Whenever I run analyze > run code analysis on solution I would always get a c1xx : fatal error C1253: Unable to load model file 'res://mspft140.dll/300'. This happens to every project, new or existing. MSDN is not particularly helpful about this one.
The string is a res protocol, so I checked if the dll mentioned is at its correct location (there are two actually, at c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ and c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64), and opened them with resedit. Both contain an XML resource named 300, so I don't see any reason for VS being unable to load it. Resetting the settings didn't help, full uninstall and reinstall (half a day wasted) did neither.
I also ran procmon with [Path] [contains] [mspft] filter while running the code analysis in VS, but the file system results are only SUCCESS and FILE LOCKED WITH ONLY READERS, which seems to be ok.
Did anyone experience this error? Does anyone have any surmises about its cause?
Update: After looking thoroughly through many more procmon captures with different filters I found out that cl.exe tries to open this registry key value: HKCR\PROTOCOLS\Handler\res\CLSID. Clearly it looks for the handler of the res protocol mentioned in the error output - and it's not there to be found, while many siblings of res key refer to some valid handlers, for example, http key has CLSID value of {79eac9e2-baf9-11ce-8c82-00aa004ba90b}. I guess that my quest for now is figuring out what that res CLSID is meant to be.
I was right in my assumption about the res protocol handler. The correct HKCR\PROTOCOLS\Handler\res\CLSID value is {3050f3bc-98b5-11cf-bb82-00aa00bdce0b} (which refers to C:\Windows\System32\mshtml.dll). For some reason my registry was missing it; as soon as I added the value, the code analysis started working without errors.
I hope this helps someone, although I believe the bug is extremely rare.