VS2015.3/PTVS Python Tools no longer working? - python-2.7

strong textI reinstalled VS 2015 Update 3 (from Web install) w/Python Tools, but Python Tools don't seem to work anymore. From ActivityLog.xml, the error is:
<record>494</record>
<time>2016/07/04 15:59:16.031</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Python Tools
Package]Source:
&apos;Microsoft.VisualStudio.Composition&apos;
Description: Expected 1 export(s) with contract name
"Microsoft.PythonTools.Interpreter.IInterpreterOptionsService"
but found 0 after applying applicable constraints.
#x000D;
Microsoft.VisualStudio.Composition.CompositionFailedException:
Expected 1 export(s) with contract name
"Microsoft.PythonTools.Interpreter.IInterpreterOptionsService"
but found 0 after applying applicable constraints.
Microsoft.VisualStudio.Composition.ExportProvider.GetExports
(ImportDefinition importDefinition)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExports
[T,TMetadataView](String contractName, ImportCardinality
cardinality)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport
[T,TMetadataView] (String contractName)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]
(String contractName)
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]
()
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue
[T] ()
at
Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService
[T] ()
at
Microsoft.PythonTools.PythonToolsService..ctor(IServiceContainer
container)
at
Microsoft.PythonTools.PythonToolsPackage.Initialize()
at
Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.
Interop.IVs Package.SetSite(IServiceProvider sp)</description>
<guid>{6DBD7C1E-1F1B-496D-AC7C-C55DAE66C783}</guid>
<hr>80131500</hr> <errorinfo></errorinfo>
I de-installed/re-installed VS 2015 Python support (directly from PTVS 2.2.4 VS 2015.msi). Same error.
What to do? The Machine (Win 10) has Python 2.7/x64 in PATH.
There seems to be a real problem for other too. See here:
Visual Studio Python Environments window does not display
Interestingly, I have two similar dev machines (Win10/x64), both installed recently, both have VS 2013Pro + VS2015 Community installed. On one box, everything works fine, on the other: see above.

Had the same issue.
Visual Studio 2015 Update 3, PTVS 2.2.4
Resolved it by:
Closing VS
Clearing the content of C:\Users\YOUR_USERNAME\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache folder. * notice the YOUR_USERNAME and replace it with your actual username to get the local path.
Relaunching VS.
Hope this helps

Delete the contents from the following folders:
C:\Users{user}\AppData\Local\Microsoft\VisualStudio
C:\Users{user}\AppData\Local\Microsoft\VSCommon
and run Visual Studio 2015 again:
[x64] C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
[x86] C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE

It seems like they fixed these issues in PTVS 2.2.5: github.com/Microsoft/PTVS/issues/1411 and github.com/Microsoft/PTVS/issues/1415

Control Panel/Uninstall change
Select VS2015, click change
Once the dialog builds, select modify, then select Python tools.
Done.

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

Building Visual Studio 2010 C++ project with a system that has only Visual Studio 2017 installed

We're currently upgrading our systems and want to use that opportunity to upgrade from VS 2010 to VS 2017.
Before switching over, we're running some tests with our existing projects (C++ and C#). Compiling and debugging C# projects worked - as expected - without a hitch.
We've got one pretty big C++ solution that we'd also like to continue developing in VS 2017, but for now we'd like to neither upgrade the platform toolset or sdk version.
Just installing VS 2017 and compiling the solution results in the error:
The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".
While googling i've found the following question: How to install Visual Studio Build Tools 2010 on Visual Studio 2015 Community?
Which is similar to the problem we're facing. I tried installing the Headers and Tools from the Windows 7 SDK. I also installed the C++ Compiler Update, but now get the following errors (for every project):
Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. in C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets on line 297
Required file "" is missing. in C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets on line 153
The element mentioned in above error has the following text:
<!-- Rest of the sources -->
<CL Condition="'%(ClCompile.PrecompiledHeader)' != 'Create' and '%(ClCompile.ExcludedFromBuild)'!='true'"
BuildingInIDE ="$(BuildingInsideVisualStudio)"
Sources ="#(ClCompile)"
AdditionalIncludeDirectories ="%(ClCompile.AdditionalIncludeDirectories)"
AdditionalOptions ="%(ClCompile.AdditionalOptions)"
AdditionalUsingDirectories ="%(ClCompile.AdditionalUsingDirectories)"
AssemblerListingLocation ="%(ClCompile.AssemblerListingLocation)"
AssemblerOutput ="%(ClCompile.AssemblerOutput)"
BasicRuntimeChecks ="%(ClCompile.BasicRuntimeChecks)"
BrowseInformation ="%(ClCompile.BrowseInformation)"
BrowseInformationFile ="%(ClCompile.BrowseInformationFile)"
BufferSecurityCheck ="%(ClCompile.BufferSecurityCheck)"
CallingConvention ="%(ClCompile.CallingConvention)"
CompileAsManaged ="%(ClCompile.CompileAsManaged)"
CompileAs ="%(ClCompile.CompileAs)"
DebugInformationFormat ="%(ClCompile.DebugInformationFormat)"
DisableLanguageExtensions ="%(ClCompile.DisableLanguageExtensions)"
DisableSpecificWarnings ="%(ClCompile.DisableSpecificWarnings)"
EnableEnhancedInstructionSet ="%(ClCompile.EnableEnhancedInstructionSet)"
EnableFiberSafeOptimizations ="%(ClCompile.EnableFiberSafeOptimizations)"
EnablePREfast ="%(ClCompile.EnablePREfast)"
ErrorReporting ="%(ClCompile.ErrorReporting)"
ExceptionHandling ="%(ClCompile.ExceptionHandling)"
ExcludedInputPaths ="$(ExcludePath)"
ExpandAttributedSource ="%(ClCompile.ExpandAttributedSource)"
FavorSizeOrSpeed ="%(ClCompile.FavorSizeOrSpeed)"
FloatingPointExceptions ="%(ClCompile.FloatingPointExceptions)"
FloatingPointModel ="%(ClCompile.FloatingPointModel)"
ForceConformanceInForLoopScope ="%(ClCompile.ForceConformanceInForLoopScope)"
ForcedIncludeFiles ="%(ClCompile.ForcedIncludeFiles)"
ForcedUsingFiles ="%(ClCompile.ForcedUsingFiles)"
FunctionLevelLinking ="%(ClCompile.FunctionLevelLinking)"
GenerateXMLDocumentationFiles ="%(ClCompile.GenerateXMLDocumentationFiles)"
IgnoreStandardIncludePath ="%(ClCompile.IgnoreStandardIncludePath)"
InlineFunctionExpansion ="%(ClCompile.InlineFunctionExpansion)"
IntrinsicFunctions ="%(ClCompile.IntrinsicFunctions)"
MinimalRebuild ="%(ClCompile.MinimalRebuild)"
MultiProcessorCompilation ="%(ClCompile.MultiProcessorCompilation)"
ObjectFileName ="%(ClCompile.ObjectFileName)"
OmitDefaultLibName ="%(ClCompile.OmitDefaultLibName)"
OmitFramePointers ="%(ClCompile.OmitFramePointers)"
OpenMPSupport ="%(ClCompile.OpenMPSupport)"
Optimization ="%(ClCompile.Optimization)"
PrecompiledHeader ="%(ClCompile.PrecompiledHeader)"
PrecompiledHeaderFile ="%(ClCompile.PrecompiledHeaderFile)"
PrecompiledHeaderOutputFile ="%(ClCompile.PrecompiledHeaderOutputFile)"
PreprocessKeepComments ="%(ClCompile.PreprocessKeepComments)"
PreprocessorDefinitions ="%(ClCompile.PreprocessorDefinitions)"
PreprocessSuppressLineNumbers ="%(ClCompile.PreprocessSuppressLineNumbers)"
PreprocessToFile ="%(ClCompile.PreprocessToFile)"
ProcessorNumber ="%(ClCompile.ProcessorNumber)"
ProgramDataBaseFileName ="%(ClCompile.ProgramDataBaseFileName)"
RuntimeLibrary ="%(ClCompile.RuntimeLibrary)"
RuntimeTypeInfo ="%(ClCompile.RuntimeTypeInfo)"
ShowIncludes ="%(ClCompile.ShowIncludes)"
SmallerTypeCheck ="%(ClCompile.SmallerTypeCheck)"
StringPooling ="%(ClCompile.StringPooling)"
StructMemberAlignment ="%(ClCompile.StructMemberAlignment)"
SuppressStartupBanner ="%(ClCompile.SuppressStartupBanner)"
TreatSpecificWarningsAsErrors ="%(ClCompile.TreatSpecificWarningsAsErrors)"
TreatWarningAsError ="%(ClCompile.TreatWarningAsError)"
TreatWChar_tAsBuiltInType ="%(ClCompile.TreatWChar_tAsBuiltInType)"
UndefineAllPreprocessorDefinitions ="%(ClCompile.UndefineAllPreprocessorDefinitions)"
UndefinePreprocessorDefinitions ="%(ClCompile.UndefinePreprocessorDefinitions)"
UseFullPaths ="%(ClCompile.UseFullPaths)"
UseUnicodeForAssemblerListing ="%(ClCompile.UseUnicodeForAssemblerListing)"
WarningLevel ="%(ClCompile.WarningLevel)"
WholeProgramOptimization ="%(ClCompile.WholeProgramOptimization)"
XMLDocumentationFileName ="%(ClCompile.XMLDocumentationFileName)"
CreateHotpatchableImage ="%(CLCompile.CreateHotpatchableImage)"
TrackerLogDirectory ="%(ClCompile.TrackerLogDirectory)"
TLogReadFiles ="#(CLTLogReadFiles)"
TLogWriteFiles ="#(CLTLogWriteFiles)"
ToolExe ="$(CLToolExe)"
ToolPath ="$(CLToolPath)"
TrackFileAccess ="$(TrackFileAccess)"
MinimalRebuildFromTracking ="%(ClCompile.MinimalRebuildFromTracking)"
ToolArchitecture ="$(CLToolArchitecture)"
TrackerFrameworkPath ="$(CLTrackerFrameworkPath)"
TrackerSdkPath ="$(CLTrackerSdkPath)"
TrackedInputFilesToIgnore ="#(ClNoDependencies)"
AcceptableNonZeroExitCodes ="%(ClCompile.AcceptableNonZeroExitCodes)"
YieldDuringToolExecution ="$(ClYieldDuringToolExecution)"
>
Looking for ways to solve the warning, that the WindowsSDKDir couldn't befound led me to this question
Chaning the Platform Toolset to "Windows7.1SDK" gets rid of the "Could not find WindowsSDKDir variable from the registry." error, but the "Required file "" is missing." error remains.
Installing Visual Studio 2010 C++ Express does solve the problem (at least for compiling and running the solution in Release).
Is there a way to work with VS 2017 and without upgrading our projects without needing to install VS 2010?
It is apparently not possible. You've got to either install Visual Studio 2010 or upgrade the toolset to Visual Studio 2017 as outlined in this blogpost - and comments.

Specflow plugin failure for Visual Studio 2017

I have both VS 2015 Update 3 and VS 2017 15.7 installed on my machine. After installing new VS2017 I downloaded the specflow for visual studio 2017 to install in VS 2017 Enterprise (15.7)
I am able to build the code after I do getlatest but not when I edit. When I try to Add New Item a new feature file I am not able to do this using VS 2017 I can't see the SpecFlow feature template, or, indeed, any SpecFlow template. I get following error when I am trying to build after I edit/Add a line in the feature file -
Below is the error in .cs file for respective feature file :-
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at BoDi.ObjectContainer.NamedInstanceDictionaryRegistration.Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
at BoDi.ObjectContainer.ResolveObject(RegistrationKey keyToResolve, ResolutionList resolutionPath)
at BoDi.ObjectContainer.Resolve(Type typeToResolve, ResolutionList resolutionPath, String name)
at TechTalk.SpecFlow.Generator.UnitTestConverter.FeatureGeneratorRegistry..ctor(IObjectContainer objectContainer)
--- End of inner exception stack trace ---
t System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at TechTalk.SpecFlow.Generator.TestGeneratorFactory.CreateGenerator(ProjectSettings projectSettings)
at TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.Actions.GenerateTestFileAction.GenerateTestFile(GenerateTestFileParameters opts)
specflowvisual-studio-2017
Others in my team are able to build the latest code as well as they are able to edit feature file and build it successfully. How do I fix this issue on my local? I don't see any other updated version of SpecFlow where this issue got fixed. Please advise.

How to stop Visual Studio 2017 from randomly switching projects to run in IIS Express when they're configured to run in Local IIS?

Our team recently upgraded to Visual Studio 2017. We store our server settings in the project file to use Local IIS, but opening up the properties of the project shows it to be using IIS Express. This occurs seemingly at random and has been affecting random teammates ever since we upgraded.
The .csproj file in source control shows the following:
<PropertyGroup>
...
<UseIISExpress>false</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<Use64BitIISExpress />
...
</PropertyGroup>
as well as:
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{...}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>53703</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost/MyProject</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
When this occurs, it seems to randomly set <UseIIS>True</UseIIS> to False and teammates are accidentally checking in this change when they don't catch it. Is there a way to stop this from happening?
I was told by Microsoft support that this is a known issue with Visual Studio 15.6:
Bill Hiebert [MSFT] ยท Mar 21 at 10:11 PM 1
Apologies for the delayed response, but we have identified the issue
and are working on a fix. The problem manifests itself if the
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
section is missing from the .user file which can happen more easily in
15.6.
https://developercommunity.visualstudio.com/content/problem/208768/vs-156-does-not-respect-the-apply-server-settings.html
Turns out some team members haven't patched up their Visual Studio to latest yet.
Edit the file .csproj.user of the project and disable IIS Express:
<UseIISExpress>false</UseIISExpress>

MSBuild using wrong (platform) version of Tracker.exe

I am using VS2010 (pro) and VS2015 Express.
Recently (probably as a result of installing some other software) all my 32 bit builds started failing with
TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" #C:\Users....rsp". The handle is invalid.
(64 bit builds continue to work)
The problem appears to be MSBuild invoking the 64 bit version of Tracker.
Google tells me that others have had the opposite problem in that 64 bit builds get the same error, whilst 32 bit builds succeed
Looking at procmon I find that MSBUILD
(1) opens Registry Key
HKLM\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Full
which has an InstallPath value of
C:\Windows\Microsoft.NET\Framework\v4.0.30319\
(2) tries to open C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Tracker.exe which does not exist
(3) opens registryKey
HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86
(which does not exist, although
HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1A\WinSDK-NetFx40Tools-x86
does)
(4)opens file
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64\Tracker.exe
Which generates the error above
I'm at a loss to explain the presence of the "x64", especially as MSBuild appears to be looking for a file path in a registry key that ends in -86
From http://community.sharpdevelop.net/forums/p/11439/31258.aspx there is a wordaround to disable tracker by adding
"False" to a property group in the .vcxproj file.
But this entails changing many such files
Any advice welcome
I've been able to solve the same issue by making sure _IsNativeEnvironment environment variable is set to false.