Visual Studio 2019 crashes while opening JavaScript file - visual-studio-2019

My Visual Studio can not open JS files
Microsoft Visual Studio
---------------------------
No exports were found that match the constraint:
ContractName Microsoft.CodeAnalysis.Editor.TypeScript.ToolsOptions.FileContentTypeService
RequiredTypeIdentity Microsoft.CodeAnalysis.Editor.TypeScript.ToolsOptions.FileContentTypeService
Any recipies with ComponentCache not working,
also log
Microsoft.CodeAnalysis.Editor.TypeScript.Features.Formatting.TypeScriptEditorFormattingService.ctor(formattingHandler): expected exactly 1 export matching constraints:
Contract name: Microsoft.CodeAnalysis.Editor.TypeScript.Features.Formatting.FormattingHandler
TypeIdentityName: Microsoft.CodeAnalysis.Editor.TypeScript.Features.Formatting.FormattingHandler
but found 0.
part definition Microsoft.CodeAnalysis.Editor.TypeScript.Features.Formatting.TypeScriptEditorFormattingService
Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.VSTypeScriptEditorInlineRenameService.ctor(service): expected exactly 1 export matching constraints:
Contract name: Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api.IVSTypeScriptEditorInlineRenameService
TypeIdentityName: Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api.IVSTypeScriptEditorInlineRenameService
but found 0.
part definition Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.VSTypeScriptEditorInlineRenameService
Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.VSTypeScriptBreakpointResolutionService.ctor(implementation): expected exactly 1 export matching constraints:
Contract name: Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api.IVSTypeScriptBreakpointResolutionServiceImplementation
TypeIdentityName: Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api.IVSTypeScriptBreakpointResolutionServiceImplementation
but found 0.
part definition Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.VSTypeScriptBreakpointResolutionService
Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.VSTypeScriptLanguageDebugInfoService.ctor(implementation): expected exactly 1 export matching constraints:
Contract name: Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api.IVSTypeScriptLanguageDebugInfoServiceImplementation
TypeIdentityName: Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api.IVSTypeScriptLanguageDebugInfoServiceImplementation
but found 0.
part definition Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.VSTypeScriptLanguageDebugInfoService
Microsoft.CodeAnalysis.Editor.TypeScript.Features.Formatting.TypeScriptFormattingService.ctor(formattingHandler): expected exactly 1 export matching constraints:
Contract name: Microsoft.CodeAnalysis.Editor.TypeScript.Features.Formatting.FormattingHandler
TypeIdentityName: Microsoft.CodeAnalysis.Editor.TypeScript.Features.Formatting.FormattingHandler
but found 0.
part definition Microsoft.CodeAnalysis.Editor.TypeScript.Features.Formatting.TypeScriptFormattingService

Delete the following folder and restart Visual studio.
C:\Users\yourusername\AppData\Local\Microsoft\VisualStudio\16.0\ComponentModelCache

Related

The 'CascadePackage' package did not load correctly

I just did an update to VS2019(16.9.0) and now I get this message. (actually on two machines). A restart does not resolve the problem.
What is the CascadePackage?
Can I just say No to dialogue box and be OK?
Also...the file it mentions to examine...does not exist anymore, nore the directory it was in.
I did find this line in the latest ActivityLog.xml
<entry>
<record>894</record>
<time>2021/03/05 13:52:21.259</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [CascadePackage]Source: &apos;System.ComponentModel.Composition&apos; Description: The composition produced multiple composition errors, with 3 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
RequiredTypeIdentity Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
Resulting in: Cannot set import &apos;Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler")&apos; on part &apos;Microsoft.VisualStudio.Cascade.CascadePackage&apos;.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler") --> Microsoft.VisualStudio.Cascade.CascadePackage
2) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
RequiredTypeIdentity Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
Resulting in: Cannot set import &apos;Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler")&apos; on part &apos;Microsoft.VisualStudio.Cascade.CascadePackage&apos;.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler") --> Microsoft.VisualStudio.Cascade.CascadePackage
3) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
RequiredTypeIdentity Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
Resulting in: Cannot set import &apos;Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService")&apos; on part &apos;Microsoft.VisualStudio.Cascade.CascadePackage&apos;.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService") --> Microsoft.VisualStudio.Cascade.CascadePackage
</description>
<guid>{D86E17D6-7FC7-47F4-9259-21748EDFF93B}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
Seem like this was caused by LiveShare.
From Visual Studio Developer Community
Just search for
The 'CascadePackage' package did not load correctly
As for my two issues:
On one machine...the error went away by starting VisualStudio.
On another machine I went into Tools->Get Tools and Features...
Click on Individual components search for Live Share. Uncheck it.
Restart VS.
Go back into Tools->Get Tools and Features... Click on
Individual components search for Live Share. Check it back.
More about the ActivityLog...
Visual Studio uses a /log option on update. This creates the ActivityLog.xml.
More here /Log (devenv.exe) This is something you can also do yourself.
The description part of the ActivityLog.xml will list where the problems are. Here is an edited breakdown of the original message in the OP.
<entry>
<record>894</record>
<time>2021/03/05 13:52:21.259</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [CascadePackage]Source: &apos;System.ComponentModel.Composition&apos;
Description: The composition produced multiple composition errors, with 3 root causes.
The root causes are provided below.
Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
RequiredTypeIdentity Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
Resulting in: Cannot set import &apos;
Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler")&apos; on part &apos;
Microsoft.VisualStudio.Cascade.CascadePackage&apos;.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler") -->
Microsoft.VisualStudio.Cascade.CascadePackage
2) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
RequiredTypeIdentity
Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
Resulting in: Cannot set import &apos;
Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler")&apos; on part &apos;
Microsoft.VisualStudio.Cascade.CascadePackage&apos;.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler") -->
Microsoft.VisualStudio.Cascade.CascadePackage
3) No exports were found that match the constraint:
ContractName
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
RequiredTypeIdentity
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
Resulting in: Cannot set import &apos;
Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService")&apos; on part &apos;
Microsoft.VisualStudio.Cascade.CascadePackage&apos;.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService") -->
Microsoft.VisualStudio.Cascade.CascadePackage
</description>
<guid>{D86E17D6-7FC7-47F4-9259-21748EDFF93B}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
To fix this error, please update to Visual Studio 16.9.2 - it has been fixed there. It's also mentioned in the Release Notes:
Fixed an issue causing an error message indicating the CascadePackage did not load correctly
I am on version 16.9.4 and still experiencing this issue. However I was able to get around it by either enabling or disabling the LiveShare extension (Extensions >> Manage Extensions >> Installed >> Live Share), and then recent VS.
If this doesn't work try reverting to the previous version, or updating it.
Sometimes I have to try the above a couple of times to get it working.
Usually this error goes away on its own, after upgrading the Live Share extension and rebooting Visual Studio a couple of times (usually at least three times).
However, sometimes, that does not work. In these cases, cleaning the MEF cache as described manually (by deleting the content of %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache), or automating it via the extension Clear MEF Component Cache have solved the problem.
Clearly, if you do not wish to use Live Share, you could just disable it from the Extensions menu and the package will not even be loaded by Visual Studio.
Update: I noticed that the issue sometimes occurs even with Live Share disabled. In all my (many) attempts, toggling it resolved the startup issue after clearing the MEF cache.

Visual Studio 2019 is configured for:c++17 but it looks more like c++14

If I compile some code with the following:
#include <string_view>
std::string_view strv{ "Test 1" };
I get this error:
Error C2065 'string_view': undeclared identifier...
I tried some other c++17 code and not of it works.
I get the same errors if the C++ Language Standard is set to std:c++14
The Properties-->C/C++-->Command line contains /std:c++17
but the actual compiler command line that runs does not have this option set.
This is a community version of Visual Studio 2019 version 16.7.1
user dxiv pointed out the problem is in the Property pages Platform pulldown it should be set to ALL Platforms (or set C++17 individually for Win32 and x64 platforms).

TFS 2017, build failing because of ssrs project into the solution

I am creating build for solution which has 2 projects (ssis,ssrs and SSAS) i am getting below error. I think this is because of SSRS in the solution. I have taken VS build and passed MSBuild arguremnts: /ignore:.dtproj,.rptproj
Error messages:
Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68):Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68,11): Error MSB4226: The imported project "O:\Microsoft Visual Studio\MSBuild\Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" was not found. Also, tried to find "Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "O:\Microsoft Visual Studio\MSBuild\15.0\Bin\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3):Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3,3): Error MSB4067: The element <DeploymentModel> beneath element <Project> is unrecognized.
Process 'msbuild.exe' exited with code '1'.
Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3):Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3,3): Error MSB4067: The element <DeploymentModel> beneath element <Project> is unrecognized.
C:\Program Files (x86)\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.targets(71):C:\Program Files (x86)\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.targets(71,7): Error MSB4062: The "Microsoft.AnalysisServices.VSHostBuilder.SemanticModelGetOutputFilesTask" task could not be loaded from the assembly O:\Microsoft Visual Studio\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.dll. Could not load file or assembly 'file:///O:\Microsoft Visual Studio\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68):Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68,11): Error MSB4226: The imported project "O:\Microsoft Visual Studio\MSBuild\Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" was not found. Also, tried to find "Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "O:\Microsoft Visual Studio\MSBuild\15.0\Bin\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
Process 'msbuild.exe' exited with code '1'.

Create msix package for a website using makeappx.exe

I'm trying to create msix package for a website using makeappx.exe (eg: makeappx pack /d C:\temp\mywebsite /p C:\temp\mywebsite.msix)
What would be the executable value since this is website?
Here is my Application section from AppxManifest.xml
<Application Id="MyWebSite" Executable="MyWebSite" EntryPoint="Windows.FullTrustApplication">
Here is an error that I got:
MakeAppx : error: Error info: error C00CE169: App manifest validation
error: The app manifest must be valid as per schema: Line 23, Column
44, Reason: 'Mywebsite' violates pattern constraint of
'.+.([Ee][Xx][Ee])'. The attribute 'Executable' with value
'MyWebSite' failed to parse.
I believe you need to set the StartPage attribute, not Executable, to point to your website.
Here you can find the schema for the AppXManifest file, with more details on each attribute from the Application element.

External Merged Dictionaries Broken in Silverlight 3 RTM?

I just want to reference a resource dictionary in a referenced assembly.
Assembly name: ResourceTest.Content
Resource Dictionary Path: ./Dictionary2.xaml
This was working on SL3 Beta 1:
<ResourceDictionary Source="ResourceTest.Content;component/Dictionary2.xaml" />
I tried this in Blend 3+Sketchflow and this works (at design time):
<ResourceDictionary Source="pack://application:,,,/ResourceTest.Content;component/Dictionary2.xaml" />
But, either way, when I run from Visual Studio, I get the following error:
Attribute ResourceTest.Content;component/Dictionary2.xaml value is out of range. [Line: 10 Position: 44]
Attribute pack://application:,,,/ResourceTest.Content;component/Dictionary2.xaml value is out of range. [Line: 11 Position: 44]
Try adding a / before your Assembly name:
This should work ...

Resources