Visual Studio 2017 Installer TypeInitializationException - visual-studio

After having a problem with my installation of Visual Studio 2017 Microsoft recommended me to run InstallCleanup.exe -full this command removed Visual Studio 2017 and the Visual Studio installer from my computer but in the process broke something.
Now when I try to install Visual Studio 2017 the Visual Studio 2017 installer throws a TypeInitializationException whenever I select a version of Visual Studio to install.
The log file shows the following stack trace:
2017-05-25T17:19:18 : Verbose : Getting product. [installerId: SetupEngine, productId: Microsoft.VisualStudio.Product.Community].
2017-05-25T17:19:21 : Error : Failed to get product. [installerId: SetupEngine, productId: Microsoft.VisualStudio.Product.Community, error: TypeInitializationException at The type initializer for 'Microsoft.VisualStudio.Setup.Utility.StringUtility' threw an exception.
at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceSpecialFolders(String value)
at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceVariables(String value, IEnumerable`1 parameters)
at Microsoft.VisualStudio.Setup.ProductInstaller.GetSerializableProduct()
at Microsoft.VisualStudio.Setup.ProductsProviderService.GetProduct(String channelId, String productId)]
Unfortunately I've been unable to correct this. I've redownload the installer. uninstalled and removed anything related to VS2017, rebooted, cleaned the temp folder. Nothing seems to have any affect.
I've asked Microsoft for guidance here, but two similar bug reports here and here stay unanswered, so I've got little hope.
I would look at the source code for the StringUtility class that seems to cause the problem. But I do not believe that is open source. (I could not find a similar class on referencesource). I would also try to debug the running application by attaching a debugger, but alas I have no Visual Studio and can't install a new one :).
Does anybody have any clue how I could try to figure out what causes this Exception? Or what dependencies I could check?
Edit: after using Collect.exe to gather more information I've found the InnerException:
05/25/2017 17:55:17 : Error : System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.Setup.Utility.StringUtility' threw an exception. ---> System.ArgumentException: Absolute path information is required.
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Environment.InternalGetFolderPath(SpecialFolder folder, SpecialFolderOption option, Boolean suppressSecurityChecks)
at Microsoft.VisualStudio.Setup.Utility.StringUtility..cctor()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceSpecialFolders(String value)
at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceVariables(String value, IEnumerable`1 parameters)
at Microsoft.VisualStudio.Setup.ProductInstaller.GetSerializableProduct()
at Microsoft.VisualStudio.Setup.ProductsProviderService.GetProduct(String channelId, String productId)Failed to get a catalog
Looks like there is some sheneningans with an invalid path? But how will I ever find out what path :)?

After another day of searching I figured it out.
Notice how the stack trace includes this line
at System.Environment.InternalGetFolderPath(SpecialFolder folder, SpecialFolderOption option, Boolean suppressSecurityChecks)
So the invalid folder is one of Windows Special Folders. Of which there are only a few. With a Powershell script I tested all Special folders. I then noticed that the following powershell command threw a very similar exception.
[environment]::GetFolderPath("MyVideos")
Digging further I found the following registry key:
Note the missing \ it should be D:\Videos\ not D:Videos I manually edited this a while ago. The path seems to be valid in some Windows functions. But not in the .Net function.
I deleted the Library and then restored the defaults. (Right click, the library in the library pane to delete it. Then right click on the library icon and choose restore defaults.)
After rebooting (without it it wouldn't work) The PS script showed that the Special Folder path worked. And voila! the Visual Studio Installer also worked again :D.

Related

Error creating Visual Studio 2022 preview network installer

I'm trying to create a Visual Studio 2022 preview network installer to reuse the installation media between multiple computers.
I'm following the instructions from this page, but I'm downloading the preview installer from the VS preview page.
When I try to create the network installer from an elevated command prompt with
vs_community.exe --layout D:\VS\Community2022preview --useLatestInstaller
I'm getting the error message
Download of 'https://aka.ms/vs/17/pre/channel' succeeded using engine 'WebClient'
Download of 'https://download.visualstudio.microsoft.com/download/pr/b3f0a1e5-a37b-49a5-9c42-8724caed1f7b/b6c95d2cc95b704820db1e1355cfb2d1d075a8acf8e38b1ddaf1dafedb269521/VisualStudioPreview.vsman' succeeded using engine 'WebClient'
Catalog load operation correlation: {"id":"2d2ff4dd-dc49-49c9-94c7-35b8d0e072a6"}
Exception of type 'Microsoft.VisualStudio.Setup.UpdateRequiredException' was thrown.
Error: Exception of type 'Microsoft.VisualStudio.Setup.UpdateRequiredException' was thrown.
at Microsoft.VisualStudio.Setup.Engine.CheckForEngineUpdate(Version manifestEngineVersion)
at Microsoft.VisualStudio.Setup.Engine.Load(String path, Boolean skipVerify)
at Microsoft.VisualStudio.Setup.Layout.Commands.LayoutCommand.InvokeCommand(CancellationToken token)
at Microsoft.VisualStudio.Setup.Layout.Program.Main(String[] args)
I googled Microsoft.VisualStudio.Setup.UpdateRequiredException, but I didn't find anything.
Should this work for the VS 2022 community preview version?
Am I missing something?
Thanks!
I had the same error message with Visual Studio Professional 17.3.0. I followed Rodrigo Juarez's suggestion of removing --useLatestInstaller and that solved the problem so that seems to be the solution to this particular error.

Error when trying to build Xamarin.Android after VS 2019 update

I have a Xamarin.Forms App that used to work correctly, but after updating from Visual Studio 2017 to 2019 I am getting an exception in Xamarin.Android when trying to build the solution. I have not changed anything in my code. The exception I get is:
Error The "GenerateResourceDesigner" task failed unexpectedly.
System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
at Xamarin.Android.Tasks.ManagedResourceParser.Parse(String resourceDirectory, IEnumerable`1 additionalResourceDirectories, Boolean isApp, Dictionary`2 resourceMap)
at Xamarin.Android.Tasks.GenerateResourceDesigner.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() EventApp
I have tried every possible thing like uninstalling and reinstalling Visual Studio 2019. Clearing bin and obj folders but nothing seems to work.
Does anyone know how can i fix this issue?
Have you updated all NuGet packages? Checked all dependencies? Updated to VS 16.3.5? Although not getting the same error, I am having problems with the latest VS and XF coupled with Google Ads. Another suggestion that didn't help me, but has helped others, is to add
android:targetSdkVersion="28"
to the uses-permission tags. Is the Net Core version set properly?
My Problem is resolved. it was some issue with Visual studio 2019. I clicked on Repair visual studio in VS installer , It took sometime and then my problem is solved. Anyway Thanks For help :)

Visual Studio 2015 crashes

Visual studio that won't be repaired...
Everytime I want to compile an app on vs 2015 - it crashes. Even if I want to compile the main function or write somthing to it, there appears a window, which says
Visual Studio 2015 has stopped working
It goes same on 2013 Express version.
I have a clue why it won't work: when I open Team Explorer, an error appears:
Page '3185ed96-1cbd-4381-a439-636973542e50' not found.
I tried everything I have found in the internet and trust me - nothing worked.
I also tried some command prompt commands:
devenv.exe/ debug
devenv.exe/ resetsettings
devenv.exe/ instalvstemplates
devenv.exe/ resetskippings
devenv.exe/ resetuserdata
devenv.exe/ setup
devenv.exe/ safemode
Debug mode gave me some info about the error:
An unhandled exception of type 'System.InvalidOperationException' occurred in mscorlib.dll
Additional information: The service 'Microsoft.Internal.VisualStudio.Shell.Interop.SVsUIThreadInvokerPrivate' must be installed for this feature to work. Ensure that this service is available. HRESULT = 0x80004002
An exception was encountered while constructing the content of this frame. This information is also logged in "C:\Users\admin\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml".
Exception details:
System.ArgumentException: Parametr is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags)
at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool)
at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool)
at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid& toolWindowType, Int32 id)
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid& toolWindowType, UInt32 id)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
But still nothing I was able to find has worked.
I reinstalled VS and repaired it - still nothing.
Then I have downloaded some .dlls, microsoft visual c++ redistributable packages and used Ccleaner to clean registry.
I think it's a very strange error; if you could advise me on a fix please?
Uncheck [Tools->Options->Environment->Automatically adjust visual experience based on client performance]
Uncheck [Use hardware graphics acceleration if available]
You can leave [Enable rich client visual experience] checked
I was having a lot of problems anywhere from random crashes, to crashing my Intel Graphics display driver, I turned it off and I have had no problems, it actually runs better. Maybe it will work for you
I was facing the same issue for team explorer.
First of all close all instances of visual studio and then try:
devenv /resetuserdata
Run above command at the command prompt; typically something similar to "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE"
Possible fix for these type errors:
try to update device driver (Intel HD Graphics) or Run with graphic driver if u got switch based or vice versa.
main executable is located
C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\IDE\devenv.exe
Also if you are getting these type error on installation exe you can fix it the same way
Visual Studio uses WPF:
From this link: "Windows Presentation Foundation (WPF) differs from prior application platforms on Windows in that it uses its own DirectX-based hardware-accelerated rendering pipeline, when available, to draw the contents of any WPF windows. Prior application platforms were typically much less dependent on display driver quality because the bulk of their rendering was done in software rather than hardware."
So, it may conflict with the display driver causing it to stop if you don't have latest display driver or the latest .NET framework. Though there might be other reasons.
There is also a registry settings(regedit) which might help:
You can add a new DWORD(for 32-bit systems) or QWORD(for 64-bit) by going to [HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Control->GraphicsDrivers]
and setting the name to "TdrDelay" and value to "8". Make sure the value's base is set to hexadecimal. TDR- Timeout Detection and Recovery.
If any of the above doesn't work. Try disabling any hardware accelerated rendering features in Visual Studio from [Tools->Options]. From your ActivityLog file, it seems that the exceptions are mostly in the graphics methods. So, my guess is it has to do with graphics rendering.
Click on Tools menu > Import and Export Settings > Reset all settings > Next > "No, just reset settings, overwriting all current settings" > Next > Finish.
i have faced problem of visual studio installation
it stop before start installation and i just go to control panel > programs >Turn windows features on or of > just uncheck all the .NETframework versions and restart your machine and then start the installation
this just how it works with me
You can also try closing VS, deleting the bin directory then attempting to debug again – it has worked for me.
It's been a while, but I'm seeing similar behavior since today.
Every time I load our solution, VS2015 crashes and restarts.
Windows Event Log shows 'out of memory exception' but there's over 2GB free at the time of the crash. the faulting module is KERNELBASE.DLL
In case this helps anyone:
Faulting application name: devenv.exe, version: 14.0.25420.1, time stamp: 0x57685d85
Faulting module name: KERNELBASE.dll, version: 6.1.7601.23915, time stamp: 0x59b94abb
I'm suspecting a windows update, as none of my colleagues have this problem and unfortunately I'm that nerd who always installs his updates ASAP.
I found this SOF article and tried everything listed.
And I found a new caveat to this voodoo.
Mine falls under the "the dumbest reason ever" category.
My temp folder was "full". So I did a disk clean up, and that deleted the FILES. However, I had a large amount of subfolders in my temp folder and while they were empty, the folders themselves were causing GetTempFile functions to fail.
So when I ran
"C:\blah\blah\blah\IDE\devenv.exe" /log
the log entries in ActivityLog.xml were showing something like this:
System.IO.IOException: The file exists.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.IO.Path.InternalGetTempFileName(Boolean checkHost)
at System.Windows.Input.Cursor.LoadFromStream(Stream cursorStream)
at Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMargin.get_RightArrowCursor()
at Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMarginProvider.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__2(IWpfTextViewMarginProvider mp)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)
In that log entry text, don't miss the text "System.IO.Path.InternalGetTempFileName"
So several places said "delete your temp files", which I did, but I still got the same issues. :(
Then I took a look at the temp directory, and I saw something weird. A large amount of (empty) subfolders.
So once I discovered I had a bunch of subfolders in my temp directory, I cleaned up these subfolders.
I found this question:
How to delete files/subfolders in a specific directory at command prompt in Windows
So I used this code:
I put this code in a .bat file
del /q "C:\Users\MYUSERNAME\AppData\Local\Temp\*"
FOR /D %%p IN ("C:\Users\MYUSERNAME\AppData\Local\Temp\*.*") DO rmdir "%%p" /s /q
And now my Visual Studio is running ok again.
Wow, go figure.
if you're using windows 10. Try installing VS2015 update 3
https://learn.microsoft.com/en-us/previous-versions/mt752379(v=vs.140)?redirectedfrom=MSDN

'exception has been thrown by a target of invocation' when starting up Visual Studio 2010

When I start up Visual Studio 2010 I often get the error 'exception has been thrown by a target of invocation' which prevents me from opening Visual Studio. A reboot of my computer makes the error go away, but a few days later it returns.
What causes this error and how can I get rid of it?
I've found a lot of questions on SO that mention this error when running their code in Visual Studio, but none when opening Visual Studio.
It seems the problem was that my system path became too long for Windows to handle: it was over the 2048 characters limit (hat tip to this article).
I had this issue with Visual Studio 2012 today. Something seemed to be gone wrong during the first setup, so it helped to delete these registry entries:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config
Visual Studio will then setup again when you start it. You can also just rename it.
I had the same problem with Visual Studio 2012 and SQL Server Management Studio, solution was to reduce the SYSTEM PATH variable length.
Symptoms: After one instance of Visual Studio 2012 was started, any other attempt to start another or one of SQL Server Management Studio would fail. The computer reboot would allow me to start again a single instance of VS2012.
Repairing the VS2012 installation didn't help.
None of these solutions solved the problem with my Visual Studio 2012, but I finally managed to fix it by installing the latest Update 4 from the Visual Studio website
My path also seemed to affect accessing Advanced System Settings from Control Panel\system\Advanced system Settings so I was unable to edit the path.
Had to launch this from windows\system32 to display the Advanced System Settings dialog, then edit te environment variables from there.
A recent install of the MEAN stack had added a path statement for my user account. I removed this setting entirely and then VS2010 and the Advanced System Settings dialog started without problem.
BioGeek's answer fixed my issue. In my case, the overflow of system path not only break visual studio, it also break the GUI to change system path itself.
I got error on: Control Panel > System > Advanced system settings.
The workaround is run c:\windows\system32\SystemPropertiesAdvanced.exe.
I had a similar problem while trying to run the "Task Runner Explorer" in VS2015, I got an error:
"Exception has been thrown by the target of an invocation".
I solved it by reinstalling only the "Microsoft ASP.NET and Web Tools" patch (DotNetCore.1.0.0-VS2015Tools.Preview2.exe) from this link.
I received this error when I installed SQL Server Express 2014 on a machine that already had 2012. I installed it with tools, which apparently broke SSMS 2012. Specifically when trying to "Edit top 200 rows" the error was thrown.
Using SSMS 2014 seems to work fine.
To add to BioGeek's answer. You don't necessarily have to get rid of entries in your path, you can work around the character limitation by introducing more variables.
e.g.
PATH = {1800 CHARACTER LONG STRING}{500 MORE CHARACTERS}
You would add a EXTENDEDPATH variable, like so:
EXTENDEDPATH = {500 MORE CHARACTERS}
And finally you reference this variable in your PATH
PATH = {2000 CHARACTER LONG STRING};%EXTENDEDPATH%;
I'd recommend leaving at least 100-200 characters of breathing room in your path so you don't have to be babysitting the PATH environment variable every time you install something.
System Path variable is too long. Copy current content to notepad and remove repeated entries and unwanted enteries and copy back to path variable.
In my case this error was due to an invalid key in the web.config file. Try to revert last changes made to the file.
i had same problem but i figured out "connectionStrings" must be under "configSections" in the web.config
This problem occurs due to long path in your environment variable windows supports only 2048 characters.
In order to solve this problem you need to remove few environment varibale from your system from PATH.
I had the same problem with Atmel Studio 7. Resolved by deleting the *.componentinfo.xml file in the same folder as the project file.

Visual studio has encountered an exception

So, I'm using Visual Studio 2010, and in the past week or I'm getting a message from Visual Studio coming up: "Visual Studio has encountered an exception. This may be caused by an extension."
My ActivityLog.xml reveals logs this as the problem:
<entry>
<record>321</record>
<time>2012/09/20 16:52:36.126</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below.
Review the CompositionException.Errors property for more detailed information.
1) Object reference not set to an instance of an object.
Resulting in: An exception occurred while calling the &apos;OnImportsSatisfied&apos; method on type &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword&apos;.
Resulting in: Cannot activate part &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword&apos;.
Element: Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword --> Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword
Resulting in: Cannot get export &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword (ContractName="Microsoft.VisualStudio.Text.Classification.EditorFormatDefinition")&apos; from part &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword&apos;.
Element: Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword (ContractName="Microsoft.VisualStudio.Text.Classification.EditorFormatDefinition") --> Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSKeyword
at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(ComposablePart part, ExportDefinition export, Boolean isSharedPart)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
at System.ComponentModel.Composition.Primitives.Export.get_Value()
at System.ComponentModel.Composition.ExportServices.GetExportedValueFromLazy[T](Export export)
at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass4`2.<CreateStronglyTypedExportOfTM>b__1()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension](Object errorSource, Lazy`1 provider)</description>
</entry>
<entry>
<record>322</record>
<time>2012/09/20 16:52:36.202</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) Object reference not set to an instance of an object.
Resulting in: An exception occurred while calling the &apos;OnImportsSatisfied&apos; method on type &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment&apos;.
Resulting in: Cannot activate part &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment&apos;.
Element: Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment --> Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment
Resulting in: Cannot get export &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment (ContractName="Microsoft.VisualStudio.Text.Classification.EditorFormatDefinition")&apos; from part &apos;Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment&apos;.
Element: Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment (ContractName="Microsoft.VisualStudio.Text.Classification.EditorFormatDefinition") --> Microsoft.VisualStudio.Web.Exports.ExportedClassificationFormatCSSComment
at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(ComposablePart part, ExportDefinition export, Boolean isSharedPart)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
at System.ComponentModel.Composition.Primitives.Export.get_Value()
at System.ComponentModel.Composition.ExportServices.GetExportedValueFromLazy[T](Export export)
at System.ComponentModel.Composition.ExportServices.<>c__DisplayClass4`2.<CreateStronglyTypedExportOfTM>b__1()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension](Object errorSource, Lazy`1 provider)</description>
</entry>
There doesn't seem to be any specific action that causes this, sometimes it happens when I first fire up VS, sometimes after I leave my desk for awhile and come back. Also, from the log, it appears to happen right after loading the Visual Studio CSS Editing Package. I have MVC4 installed, maybe it's a problem with the new CSS (CSS3 I think?)
Anyways, just wondering if anybody had run into this before and had some sort of resolution.
seems some VS extension may be causing it to crash. (did you install extension any recently?)
try running VS in safe mode to diagnose the problem.
Run this command and check if VS starts
devenv.exe /safemode
More here
http://blog.meidianto.com/2010/05/16/vs2010-tips-8-got-annoying-visual-studio-2010-error-try-to-run-in-safe-mode/
VS needs Administrator previleges to handle the plugin. So right click VS and click "RUN AS ADMINISTRATOR". It solved for me. Try once.
I had the same error and my ActivityLog.xml showed the following error:
System.ComponentModel.Composition.CompositionException: The
composition produced a single composition error. The root cause is
provided below. Review the CompositionException.Errors property for
more detailed information.
1) No
exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator
RequiredTypeIdentity Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator
Resulting
in: Cannot set import
&apos;Microsoft.Web.Editor.Composition.ComponentLocator(Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator)+SingleImporter.Import
(ContractName="Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator")&apos;
on part
&apos;Microsoft.Web.Editor.Composition.ComponentLocator(Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator)+SingleImporter&apos;.
Element:
Microsoft.Web.Editor.Composition.ComponentLocator(Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator)+SingleImporter.Import
(ContractName="Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator")
--> Microsoft.Web.Editor.Composition.ComponentLocator(Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.IWebLinterAggregator)+SingleImporter
at
System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition
atomicComposition)
at
System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImportsOnce(ComposablePart
part)
at
System.ComponentModel.Composition.Hosting.CompositionContainer.SatisfyImportsOnce(ComposablePart
part)
at
Microsoft.VisualStudio.Composition.NetFxAdapters.CompositionService.SatisfyImportsOnce(ComposablePart
part)
at
System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce(ICompositionService
compositionService, Object attributedPart)
at
Microsoft.Web.Editor.Composition.ComponentLocator`1.Import()
at
Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.LinterUtilities.<>c.<.cctor>b__4_1()
at System.Lazy`1.CreateValue()
at
System.Lazy`1.LazyInitValue()
at
System.Lazy`1.get_Value()
at
Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.LinterUtilities.IsFileSupported(String
fileName)
at
Microsoft.VisualStudio.Web.Editor.Package.Lint.ErrorTagger.LintErrorTaggerProvider.CreateTagger[T](ITextBuffer
textBuffer)
at
Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer
textBuffer)
Solved it by going to Tools -> Extensions and Updates -> Updates -> Visual Studio Gallery -> Installed the new version of Microsoft ASP.NET and Web Tools
(The following solution worked for me)
I just clicked on the solution file and by default it has tried to open the *.sln file in visual studio 2015 and then I have got the error message "Visual Studio has encountered an exception. This may be caused by an extension".
I had two visual studio version installed - visual studio 2015 & visual studio 2017. I opened the *.sln file in notepad and I could see VisualStudioVersion = 14.0.24720.0 which indicates the solution was created in visual studio 2015.
Then I right clicked the *.sln file and choose the vs 2017 to open it. Then it has open successfully. My best guess is one of the visual studio 2015 extension was not loading correctly and that is why I was receiving that error message.
Try this
Tools->Import and export settings->Reset all settings.
Download web essentials for your VS version. It sorted my issue regarding ActivityLog.xml.
Web Essential

Resources