An error was encountered while initializing templates Visual Studio 2019 - visual-studio

I get this error when I try to add a Razor Page:
I've tried cleaning the project and even repairing Visual Studio via the installer to no avail.
Opening the indicated log, I can see at the end:
<entry>
<record>3545</record>
<time>2021/01/26 11:36:35.647</time>
<type>Error</type>
<source>Template Bootstrapper</source>
<description>Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Path &apos;&apos;, line 1, position 25.
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.EnsureInstallDescriptorsLoaded()
at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.WriteInstallDescriptorCache()
at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.Save(TemplateCache cacheToSave)
at Microsoft.TemplateEngine.Edge.Settings.SettingsLoader.Save()
at Microsoft.TemplateEngine.Edge.Settings.ComponentManager.Save()
at Microsoft.TemplateEngine.Edge.Settings.ComponentManager.RegisterMany(IEnumerable`1 typeList)
at Microsoft.TemplateEngine.IDE.Bootstrapper.Register(Assembly assembly)
at Microsoft.VisualStudio.TemplateEngine.Shared.Host.TemplateEngineBootstrapperFactory.TemplateEngineBoostrapper.Register(Assembly assembly)
at Microsoft.VisualStudio.TemplateEngine.TemplateEngineHostManager.InitializeEngine()</description>
</entry>

Try updating Visual Studio to the latest version. That solve our issue when we encountered the same problem

Related

System.IO.IOException during the build process in VisualStudio 2017

I'm working on a Hololens application using Unity 2018.2.20f1. I'm building the application for UWP from Unity without a problem. However, after opening up the generated solution in the VisualStudio 2017 (Community Edition) and trying to build it, the build process fails with the following errors:
Severity Code Description Project File Line Suppression State
Error MSB3073 The command ""D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\IL2CPP\build\il2cpp.exe" --libil2cpp-static --compile-cpp -architecture=x86 -configuration=Release -platform=winrt -outputpath="D:\Projects\VSProjects\VirtualPrague\\build\bin\Win32\Release\GameAssembly.dll" --data-folder="D:\Projects\VSProjects\VirtualPrague\\build\bin\Win32\Release\\" -cachedirectory="D:\Projects\VSProjects\VirtualPrague\\build\obj\il2cppOutputProject\Win32\Release\\" -generatedcppdir="D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\Source" --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityjit -verbose --map-file-parser="D:\Projects\VSProjects\VirtualPrague\Il2CppOutputProject\\IL2CPP\MapFileParser\MapFileParser.exe"" exited with code -532462766. Il2CppOutputProject C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets 44
and
Severity Code Description Project File Line Suppression State
Error LNK1181 cannot open input file 'D:\Projects\VSProjects\VirtualPrague\build\bin\Win32\Release\GameAssembly.lib' VirtualPrague D:\Projects\VSProjects\VirtualPrague\VirtualPrague\LINK 1
In the output there are multiple exceptions, similar to this one:
1>il2cpp.exe didn't catch exception: System.IO.IOException: The process cannot access the file 'C:\Users\dev\AppData\Local\Temp\tmpDE97.tmp' because it is being used by another process.
1> at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
1> at System.IO.File.InternalDelete(String path, Boolean checkHost)
1> at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller)
1> at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
1> at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
1> at il2cpp.Program.DoRun(String[] args)
1> at il2cpp.Program.Run(String[] args)
1> at il2cpp.Program.Main(String[] args)
The exceptions are the same but were thrown for different files. I tried to reinstall the Visual Studio and managed to get a build. The next day I turned on the PC and this error was back. I stopped all of the VS instances and processed from the task manager, deleted all of the files from the Temp folder and managed to get a build a couple more times. Then this error came back.
From what I can tell, during the build process, Visual Studio creates some *.tmp files and for some reason thinks that another process is using it.
Any idea why this is happening and how can it be solved?
Thanks a lot!
Edit: So here is what I did so far (this is more of a work around rather then a solution)
Uninstall vs and unity
Clear the registry with ccleaner and Advanced Uninstaller Pro
Install vs and Unity
Every time I want to get a build I,
Close all of vs instances
Clear Temp folder (C:\Users\dev\AppData\Local\Temp)
Delete previous vs solution
Build from Unity
Run vs as Administrator
Build and deploy the solution from vs
And it works for the most the time. Also, changing the solution configuration (from debug to release and vice versa) helps sometimes.

Can't debug VSIX project: "Expected export ITextEditorFactoryService but found 0"

I am working in a couple of VSIX projects and suddenly, for some reason, I can't properly debug them. When I run the project, the experimental VS instance opens without issues, but as soon as I load a solution the problems begin.
To start with, if the solution I'm loading is under source control I get the following error message:
The 'GitCollaborationPackage' package did not load correctly.
The problem may have been caused by a configuration change
or by the installation of another extension.
There's also a link to a log file, which shows an apparently not very useful error message:
LegacySitePackage failed for package [GitCollaborationPackage] Source:
"" Description: Catastrophic failure (Exception from HRESULT:
0x8000FFFF (E_UNEXPECTED))
After that the solution loads, but as soon as I try to open a file I get this error:
Expected 1 export(s) with contract name
"Microsoft.VisualStudio.Text.Editor.ITextEditorFactoryService" but
found 0 after applying applicable constraints.
I didn't perform any significant change in my projects, but just in case I created a fresh new VSIX project and ran it right away, with identical results.
As suggested in MSDN I tried to delete Visual Studio's component cache and reset Visual Studio's settings, to no avail.
So what's going on here? What can I do to fix this?
UPDATE: A couple of new findings:
When running Visual Studio with devenv /safemode the problem persists.
This is happening in VS Professional edition. I have Community edition installed as well, and in that one I can debug without issues. Damn, that one got somehow corrupted too! :-(
UPDATE 2: Repairing Visual Studio didn't help.
This is not an answer, but it's been two years and the problem remains serious, so I thought it might be worthwhile to add some detail for the sake of future investigation.
On my machine the experimental instance was working earlier today, but now it fails. The initial error most often reads
The 'RoslynPackage' package did not load correctly. The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users...\AppData\Roaming\Microsoft\VisualStudio\15.0_b0b65856Exp\ActivityLog.xml'.
But the failing package occasionally varies, and in any case the second error (involving ITextEditorFactoryService) soon follows.
Deleting the two VisualStudio\15.0_b0b65856Exp folders in AppData doesn't help, so I tried uninstalling and reinstalling VS2017. That didn't help either.
I tried debugging a "known good" Visual Studio extension. Same error. I tried loading a simple text file. Same error.
So I moved on to Visual Studio 2019 Community (which was already installed before the failures started). VS 2019 fails too, but its behavior is slightly different: the first error message does not appear, and the second error is slightly modified (notice the "2"):
Expected 1 export(s) with contract name "Microsoft.VisualStudio.Text.Editor.ITextEditorFactoryService2" but found 0 after applying applicable constraints.
I noticed that when I reinstalled VS2017, it still picked up on settings left over from the previous installation. And when the experimental instance starts, it asks me which theme I want. I tell it to use the Blue Theme, and for a few seconds it does, but then it loads Dark Theme which is the same theme used by the main instance. This leads to a hypothesis that the failure is caused by a "zombie" configuration setting that the experimental instance is choosing to load, a setting we just don't know how to get rid of. However, I tried dragging a .cs file onto the experimental instance immediately (before the dark theme loads) and the error still occurs. Also, I tried Tools -> Import and Export Settings -> Reset all Settings (inside the experimental instance), which didn't help.
In my case the command-line arguments /rootsuffix Exp /safemode prevent the error from happening, but this is useless because it also blocks the VSIX I'm trying to debug from loading.
Here are the entries in ActivityLog.xml that mention the word "error":
<entry>
<record>523</record>
<time>2020/03/11 00:20:56.182</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Unexpected system error mode before loading package [ProviderPackage]</description>
<guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
</entry>
<entry>
<record>527</record>
<time>2020/03/11 00:20:56.494</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Unexpected system error mode before loading package [Microsoft.VisualStudio.Shell.Connected.Packages.PathTrustVerifier.PathTrustVerifierPackage]</description>
<guid>{2F6B5046-3BB0-4825-B344-3F4238921119}</guid>
</entry>
<entry>
<record>531</record>
<time>2020/03/11 00:20:56.511</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Unexpected system error mode before loading package [CSharpPackage]</description>
<guid>{13C3BBB4-F18F-4111-9F54-A0FB010D9194}</guid>
</entry>
<entry>
<record>534</record>
<time>2020/03/11 00:20:56.590</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Unexpected system error mode before loading package [RoslynPackage]</description>
<guid>{6CF2E545-6109-4730-8883-CF43D7AEC3E1}</guid>
</entry>
<entry>
<record>537</record>
<time>2020/03/11 00:20:56.811</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Unexpected system error mode before loading package [ErrorListPackage]</description>
<guid>{4A9B7E50-AA16-11D0-A8C5-00A0C921A4D2}</guid>
</entry>
<entry>
<record>541</record>
<time>2020/03/11 00:20:57.014</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Unexpected system error mode before loading package [Text Management Package]</description>
<guid>{F5E7E720-1401-11D1-883B-0000F87579D2}</guid>
</entry>
<entry>
<record>545</record>
<time>2020/03/11 00:20:57.026</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Unexpected system error mode before loading package [Microsoft.VisualStudio.Editor.Implementation.EditorPackage]</description>
<guid>{E269B994-EF71-4CE0-8BCD-581C217372E8}</guid>
</entry>
<entry>
<record>548</record>
<time>2020/03/11 00:20:57.457</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [RoslynPackage]Source: &apos;Microsoft.VisualStudio.Composition&apos; Description: Expected 1 export(s) with contract name "Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.VisualStudioDiagnosticListTableCommandHandler" but found 0 after applying applicable constraints.
Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource.VisualStudioDiagnosticListTableCommandHandler" 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.GetExport[T]()
at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]()
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]()
at Microsoft.VisualStudio.LanguageServices.Setup.RoslynPackage.LoadComponentsInUIContext()
at Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService.AbstractPackage.LoadComponentsInUIContextOnceSolutionFullyLoaded()
at Microsoft.VisualStudio.LanguageServices.Setup.RoslynPackage.Initialize()
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)</description>
<guid>{6CF2E545-6109-4730-8883-CF43D7AEC3E1}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>549</record>
<time>2020/03/11 00:20:57.469</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [RoslynPackage](null)</description>
<guid>{6CF2E545-6109-4730-8883-CF43D7AEC3E1}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>551</record>
<time>2020/03/11 00:20:57.479</time>
<type>Warning</type>
<source>VisualStudio</source>
<description>Unexpected system error mode before loading package [Visual Studio Component Enumerator Package]</description>
<guid>{588205E0-66E0-11D3-8600-00C04F6123B3}</guid>
</entry>
<entry>
<record>555</record>
<time>2020/03/11 00:20:57.490</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [RoslynPackage]</description>
<guid>{6CF2E545-6109-4730-8883-CF43D7AEC3E1}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
Note: the above error is the final entry in ActivityLog.xml; The second error doesn't show up here.
For me, this started happening after using a IViewTaggerProvider instead of an IViewProvider. When changing it back, it works.
Not sure why though, and I really need to be able to use a IViewTaggerProvider, but I hope this lets others get more insight.
Edit: Okay, I solved it! It was due to the type in my Export attribute not matching the implemented type.
So I changed:
[Export(typeof(ITaggerProvider))]
[ContentType("code")]
[TagType(typeof(ToDoTag))]
class ToDoTaggerProvider : IViewTaggerProvider
{ ... }
Into:
[Export(typeof(IViewTaggerProvider))]
[ContentType("code")]
[TagType(typeof(ToDoTag))]
class ToDoTaggerProvider : IViewTaggerProvider
{ ... }

Visual Studio stops working when trying to debug wp8.1 [duplicate]

I'm using Visual Studio 2015 in a Windows 10 environment. Visual Studio is constantly crashing. The solution opens up fine, but after typing a few letters I get a message saying that an error occurred and Visual Studio must be shut down. I searched online and found how to run VS in diagnostic mode (devenv /log). I tried this and see several errors in ActivityLog.xml. I don't know what any of these mean and I can't find anything online about them. I've updated all of the Visual Studio extensions, but that didn't help. I tried repairing VS, but that didn't help either. Can someone explain how I can diagnose and fix the problem?
Here is the error messages in the log:
<entry>
<record>161</record>
<time>2017/05/08 14:53:38.815</time>
<type>Error</type>
<source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Could not load file or assembly &apos;Microsoft.VisualStudio.Workspaces.Contracts, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.</description>
<path>C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\RV0KRPV2.PBV\TMLanguage.dll</path>
</entry>
<entry>
<record>162</record>
<time>2017/05/08 14:53:38.822</time>
<type>Error</type>
<source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Could not load file or assembly &apos;Microsoft.VisualStudio.WindowsAzure.CommonAzureTools.Contracts.1.7, Version=1.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.</description>
<path>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\2re3mhbz.g1s\Microsoft.VisualStudio.ApplicationInsights.dll</path>
</entry>
<entry>
<record>163</record>
<time>2017/05/08 14:53:38.830</time>
<type>Error</type>
<source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
<description>Still unable to load MEF component DLL: Could not load file or assembly &apos;Microsoft.VisualStudio.ApacheCordovaTools.Definitions.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&apos; or one of its dependencies. The system cannot find the file specified.</description>
<path>C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\22KH2U4Y.XLJ\Microsoft.VisualStudio.Azure.ConnectedServices.MobileServices.dll</path>
</entry>
To diag Visual Studio crashes, you need to generate a crash dump, which includes the current state of Visual Studio.
To generate such a crash dump, you can configure Windows Error Reporting to generate dumps by running regedit.exe, go to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\devenv.exe create a string DumpFolder and give it a name like C:\localdumps and create a DWORD 32Bit named DumpType and set it to 2 to generate a Full dump.
After Visual Studio crashed and you got a dump, install the Debugging Tools for Windows, which are part of the Windows 10 SDK.
During Setup you only need to select the Debugging Tools for Windows
all other can be skipped.
Now run 32 Bit/x86 Windbg.exe (because Visual Studio is a 32Bit /x86 applciation), inside Windbg, setup the debug symbols, open the dmp via File->Open crash dump (or CTRL+D) and type !analyze -v in the command line at buttom
and now press ENTER. Now Windbg loads the required debug symbols and analyzes the dump and shows you some data. In my example I see this:
BUGCHECK_STR: CLR_EXCEPTION_REMOTE_System.NullReferenceException
DEFAULT_BUCKET_ID: CLR_EXCEPTION_REMOTE_System.NullReferenceException
PRIMARY_PROBLEM_CLASS: CLR_EXCEPTION
STACK_TEXT:
00000000 00000000 Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor+0x0
00000000 00000000 Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.DTE.WindowBase.CreateMainWindow+0x0
00000000 00000000 Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.get_MainWindow+0x0
00000000 00000000 UNKNOWN!EnvDTE._DTE.get_MainWindow+0x1
00aed828 11da97b8 UNKNOWN!VSWindowTitleChanger.VSWindowTitleChangerPackage.DelayedInit+0x90
SYMBOL_NAME: Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor
MODULE_NAME: Microsoft_VisualStudio_Platform_WindowManagement_ni
BUCKET_ID: CLR_EXCEPTION_REMOTE_System.NullReferenceException_Microsoft_VisualStudio_Platform_WindowManagement_ni!Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor
FAILURE_IMAGE_NAME: Microsoft.VisualStudio.Platform.WindowManagement.dll
BUCKET_ID_IMAGE_STR: Microsoft.VisualStudio.Platform.WindowManagement.dll
FAILURE_MODULE_NAME: Microsoft_VisualStudio_Platform_WindowManagement_ni
BUCKET_ID_MODULE_STR: Microsoft_VisualStudio_Platform_WindowManagement_ni
FAILURE_FUNCTION_NAME: Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor
BUCKET_ID_FUNCTION_STR: Microsoft.VisualStudio.Platform.WindowManagement.DTE.MainWindow..ctor
BUCKET_ID_PREFIX_STR: CLR_EXCEPTION_REMOTE_System.NullReferenceException_
So the Visual Studio crashed because of a System.NullReferenceException in the module VSWindowTitleChanger which tries to change the Title of a Window before it was laoded correctly and accessed an object with was NULL. This is a Visual Studio extension and removing it fixes the crash I had at startup.
If Windbg is too complicated, you can use the DebugDiag analyzer. 1st download the Debug Diagnostic Tool v2 Update 2, now run DebugDiag.Analysis.exe from C:\Program Files\DebugDiag, select CrashHangDumpAnalysis, now click on Add Data Files and select the dump.
In last step, click on Start Analysis. Now the analyzer checks the dump
and if this is finished, it opens a mht Report wit the result.

'TestWindowPackage' package did not load correctly

I am not able to open the test Explorer
on machine had Visual Studios 2008, 2010, 2012. Then installed 2015, then 2013
Using Visual Studio 2013 update 5
'TestWindowPackage' package did not load correctly , activity log error:
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [TestWindowPackage]</description>
<guid>{BFC24BF4-B994-4757-BCDC-1D5D2768BF29}</guid>
<hr>80131509</hr>
<errorinfo>Loading MEF components failed with the following exception:
The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) The specified argument cannot be empty.
Parameter name: commandContainers
Resulting in: An exception occurred while trying to create an instance of type 'Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer'.
Resulting in: Cannot activate part 'Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer'.
Element: Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer --> Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer
Resulting in: Cannot get export 'Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer (ContractName="Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer")' from part 'Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer'.
Element: Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer (ContractName="Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer") --> Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer
Resulting in: Cannot set import 'Microsoft.VisualStudio.TestWindow.VsHost.TestWindowPackage.PackageContainer (ContractName="Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer")' on part 'Microsoft.VisualStudio.TestWindow.VsHost.TestWindowPackage'.
Element: Microsoft.VisualStudio.TestWindow.VsHost.TestWindowPackage.PackageContainer (ContractName="Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer") --> Microsoft.VisualStudio.TestWindow.VsHost.TestWindowPackage
Additional diagnostics here:
MEF Import details for Microsoft.VisualStudio.TestWindow.VsHost.TestWindowPackage
ContractName Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer
RequiredTypeIdentity Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer
Satisfied by :
Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer (ContractName="Microsoft.VisualStudio.TestWindow.VsHost.PackageContainer")
I have tried:
-Restarted Visual Studio
-Restarted PC
-Delete all files in AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
-Run VS with devenv /setup
-Run VS With devenv /setup /ResetSkipPkgs
-Repaired the VS installation
-Uninstall VS2013, Delete all visual studio files in app data, re install VS 2013 update 5
Opened ticket with Microsoft via company support account, Case number 116081014529972
They told me to reformat my machine and not install Visual Studios out of order.

Visual 2010 MFC new project doesn't build!

I just created a new project in Visual 2010. It is a multi-document MFC (static link) application with the HTML help option, Visual Studio 2008 style (with style changing option), that's about it.
Just after creation, I hit Build Solution and I get a lot build errors all in afxcomctl32.h. Errors like:
Error 1 error C2061: syntax error : identifier 'LPCWS' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxcomctl32.h 426 1
On this line:
AFX_ISOLATIONAWARE_STATICLINK_FUNC(HWND ,CreateWindowExW,(DWORD dwExStyle,LPCWS TR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam),(dwExStyle,lpClassName,lpWindowName,dwStyle,X,Y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam),NULL)
Same errors in Debug and Release.
My PC is Windows 7 Ultimate. What's the problem???
Best regards,
Downy
AFX_ISOLATIONAWARE_STATICLINK_FUNC(..., LPCWS TR lpClassName, ...)
That code got messed up, there is a space or tab inserted in LPCWSTR. Deleting it will fix the problem.
However, that changed the timestamp on the file as well, you may run into trouble when you install a future service pack. One thing to try is to rename the file, then run a Repair to get the original file back. Or copy it off another machine.

Resources