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

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

Related

Specflow skips test after execution with error: Error while unpacking executor:

after updating SpecflowRunner to 3.5.8 and re-installing the Specflow Package 2017.2.1 my tests cannot be executed and are skipped instead. When I open the log file I find this Error message:
Error while unpacking executor: System.TypeLoadException: The method "Initialize" in type "TechTalk.SpecRun.Framework.TestAssemblyExecutor" of the assembly "TechTalk.SpecRun.Framework.Executor, Version=1.8.0.0, Culture=neutral, PublicKeyToken=null" is not implemented.
(Sorry, I had to translate the message)
A friend of mine has the same versions, but everything runs smoothly. We both use Visual Studio 2017.
Did I miss something, a cache that has to be cleared or anything else?
You have probably some old leftover files from before the update in your obj and bin folder.
Close Visual Studio
delete the folders
start Visual Studio
Rebuild Solution
After that, you should be able to execute your tests again.

Why doesn't the c++ file run in visual studio

So I tried making a basic game on the console using screen buffers, I was able to create it and make a square move in the canvas, but for my next project I looked up a website with the ASCII characters and pasted a couple into a comment at the end of the c++ file, when I ran the file visual studio prompted:
I clicked yes and it didn't run anymore.
Also I recently have installed an extension for visual studio (before it didn't run, the extension works fine but I don't know if the extension may have caused this as I didn't tried running it with the extension downloaded and applied), when I open visual studio and open a file it says:
The last record in the ActivityLog xml file, has a type of error and it's description is:
Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "Microsoft.VisualStudio.CppSvc.Internal.CodeAnalysis.ICodeAnalysisService" but found 0 after applying applicable constraints.
at 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.GetExportT
at
Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at Microsoft.VisualStudio.VC.ManagedInterop.<>c.<Initialize>b__52_15()
at
System.Lazy`1.CreateValue()
at
System.Lazy`1.LazyInitValue()
at
System.Lazy`1.get_Value()
at
Microsoft.VisualStudio.VC.CodeAnalysis.ResultTaggerProvider.CreateTagger[T](ITextBuffer buffer)
at
Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)
--- End of stack trace from previous location where exception was thrown ---
at
Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
I have Visual Studio 2017
So why does running the file (with the local windows debugger button) say that there were build errors? And how can I fix it?
When it prompts the build error, and I click no it usually shows the errors but in this case it doesn't, yes will just run the last "successful" build (although I haven't changed the file since I have finished it before this error message started popping up)
Also there is no error in my code as I was able to run it before the build error kept appearing and I haven't touched the file since(only now to show the problems are)
Thanks for your time! if anything was unclear because of my English, comment and I'll try to clarify it
I fixed the error by deleting ComponentModelChache folder located at:
C:\Users\%userName%\AppData\Local\Microsoft\VisualStudio\15.0
15.0 is the version of your visual studio so it varies depending on the version you're using, %userName% is a replacement for the user you're logged in as

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.

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.

how to replace the uninstallation part of an MSI

I've build a msi installer using a VS2010 setup project.
Now the project does not deinstall because of a "1001 Exception: Invalid format for argument machineName" (see below) inside a custom action.
I am unsucessful at uninstalling the application using the remove from the system control or msiexec /uninstall.
Is there a way to force uninstallation?
Details:
As part of a custom action I register a custom event source which my app uses for event loging into the windows log:
public override void Install(IDictionary stateSaver) {
base.Install(stateSaver);
EventLog.CreateEventSource("VeodinRecorder","Application");
}
inside of the "Uninstall" I try to remove this Eventsource with
if (!EventLog.SourceExists("VeodinRecorder"))
EventLog.Delete("VeodinRecorder"); `
The EventLog.Delete also takes machinename as second argument
So I tried to overwrite the msi used for uninstallation with msiexec /fv and changed the uninstall action:
EventLog.Delete("VeodinRecorder",".");
EventLog.Delete("VeodinRecorder","Application");
I even left the whole "uninstall action" blank.
But nothing seemed to work.
Any Hints?
The full log:
Error 1001. Error 1001. An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete. --> Invalid format for argument machineName.
MSI (s) (60!68) [22:49:00:101]:
DEBUG: Error 2769: Custom Action _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall did not close 1 MSIHANDLEs.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2769. The arguments are: _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall, 1,
CustomAction _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 22:49:00: InstallExecute. Return value 3.
Action ended 22:49:00: INSTALL. Return value 3.
It seems that the CustomAction.dll was not updated when I update the installation with msiexec /fv.
I now manually placed the newly build CustomAction.dll (with an empty uninstall override) into the installation folder and was able to uninstall.
Update: (Credits to #pcans) use ORCA to edit the currently installed msi and manually disable the uninstall custom action.
Just for reference I want to add that you can also patch the installed product with a minor upgrade to remove any faulty actions in the uninstall sequence before it gets called. This works because a minor upgrade is a reinstall of the same product, and not an uninstall and a reinstall of a new version (which is a major upgrade). You hence replace the uninstall sequence with a correct one before the erronous one gets run.
Creating the patch is quite complicated though, even with professional tools such as Wise or Installshield, but in certain cases this is the only fix that works to get the package properly uninstalled. A package "in the wild" in a company should be fixed this way.
Finally you can use msizap.exe from Microsoft to unregister a whole faulty package from the Windows Installer database, but this is not good since changes to the system are not rolled back at all and lots of junk is left everywhere. The tool itself also seems a bit shaky at times, sometimes creating new errors that are really difficult to fix. Preferably use it for debugging only.
One further note in this already long reply: a special case is when you run a custom action only during the uninstall sequence, and it then returns a faulty return code - sometimes even if it performed its operations ok. These actions can trigger a very annonying "uninstall only rollback situation". Effectively your uninstall is rolled back when it hits the custom action that was never run during install. This will rollback the uninstall and hence work as an installation - your product is left on the machine. Quite strange.
The bottom line: skip return codes for custom actions that are run during uninstall, use other verification mechanisms to ensure the action succeeded.