Extension causing exception in VS2017
Posted: April 1st, 2018, 5:17 am
Using PHP Tools in Visual Studio 2017 Enterprise, I'm constantly getting "An exception has been encountered. This may be caused by an extension." Here's what the dialog looks like: https://www.screencast.com/t/GRLwSHmh
It pops up when pasting in a simple single line of code. Simple as in... $var = "text";
The relevant entry in ActivityLog.xml is:
The relevant section of code (around line 1132) is a mix of PHP & javascript, something like:
The line of code that I'm pasting in when the exception pops up is nowhere near this block; i.e. if I just paste in a simple line way at the beginning of the file, it still throws up the exception.
It pops up when pasting in a simple single line of code. Simple as in... $var = "text";
The relevant entry in ActivityLog.xml is:
- Code: Select all
<entry>
<record>681</record>
<time>2018/04/01 05:07:34.524</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.InvalidOperationException: Document is malformed. Php code on line 1132 in Html document isn't supported by formatter.
 at HtmlAgilityPack.HtmlDocument.Parse()
 at HtmlAgilityPack.HtmlDocument.Load(TextReader reader, ArtifactCollection artifacts)
 at HtmlAgilityPack.HtmlDocument.LoadHtml(String html, ArtifactCollection artifacts)
 at Devsense.VisualStudio.Html.Formatting.HtmlFormatter.FormatRange(ITextProvider textProvider, ITextRange range, ArtifactCollection artifacts, ITextRange& actualRange, String& originalText)
 at 	 		.
		
	(Span 
		
, HtmlExternalFormatters  )
 at  .  . 
()
 at Devsense.VisualStudio.Shell.GuardedOperations.Call(Object source, Action action)</description>
</entry>
The relevant section of code (around line 1132) is a mix of PHP & javascript, something like:
- Code: Select all
function exampleFunc( $someCode )
{
?>
FB.api('/me/permissions', function(response)
{
<?php echo $someCode;?>
});
<?php
}
The line of code that I'm pasting in when the exception pops up is nowhere near this block; i.e. if I just paste in a simple line way at the beginning of the file, it still throws up the exception.