-
NDC Sydney–Day 0
It’s Tuesday, so off to NDC Sydney conference. I must say 11am is a very sensible time to fly from Adelaide to Sydney. Makes a nice change from 6am flights!
I’m attending NDC as a volunteer crew member, but it turns out the organisers were extra-pleased to see me, as they’d forgotten that I was coming, and were actually short of helpers. Phew, glad that worked out well.
NDC is being held at the Sydney Hilton. I’ve actually been here many years ago attending a SharePoint conference. I wasn’t originally going to stay here on-site, but my employer (RL Solutions) encouraged me to do so and I’m really glad I did. It is super convenient to just be able to “pop upstairs” to my room.
I started right away, helping out with the registration desk for the NDC Sydney Code Club, an evening of workshops for kids aged 7-16. It was great to see some of the conference speakers had brought their families over to Australia and so their kids got a chance to participate, as well as a bunch of Sydney school kids. As a bonus, they had Scott Hanselman as their keynote speaker. I’m pleased to report the kids enjoyed Scott just as much as the adults will at the rest of the conference. Scott was entertaining and informative. I could hear lots of laughter coming from the room. After Scott’s welcome keynote, there were a number of workshops the kids participated in, including IoT, Minecraft and other fun stuff.
Here’s photo of Scott enjoying the perks of working for Microsoft (well I think that’s what he said!) from his welcome talk to the kids:
-
Error AD0001: Compiler Analyzer … threw an exception of type 'System.InvalidOperationException' with message 'Feature 'IOperation' is disabled.'
If you upgrade to the latest beta release of one of the Roslyn compiler analyzer packages, you might notice they fail with an error like this:
Compiler Analyzer 'Microsoft.ApiDesignGuidelines.Analyzers.UsePropertiesWhereAppropriateAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'Feature 'IOperation' is disabled.'.
The solution wasn’t immediately obvious to me, but I eventually tracked down this comment on a Github issue. According to the comment, the analyzers are using an API that needs to be enabled through configuration. To do this, you need open up the .csproj file and add a new property as a child of the first PropertyGroup element like this:
<PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Features>IOperation</Features>
Or if you have lots of projects, run this PowerShell script to update them all:
Get-ChildItem *.csproj -Recurse | ForEach-Object { $content = [xml] (Get-Content $_) $xmlNameSpace = new-object System.Xml.XmlNamespaceManager($content.NameTable) $xmlNameSpace.AddNamespace("p", "<a href="http://schemas.microsoft.com/developer/msbuild/2003%22)">http://schemas.microsoft.com/developer/msbuild/2003")</a> if (-not $content.Project.PropertyGroup[0].Features) { Write-Host "Features missing in $_" $featureElt = $content.CreateElement("Features", "<a href="http://schemas.microsoft.com/developer/msbuild/2003%22)">http://schemas.microsoft.com/developer/msbuild/2003")</a> $featureElt.set_InnerText("IOperation") $content.Project.PropertyGroup[0].AppendChild($featureElt) } $content.Save($_) # Normalise line endings (Get-Content $_ -Encoding UTF8) | Set-Content $_ -Encoding UTF8 }
-
What HockeyApp told me about my Visual Studio extension
Last time I wrote about how I managed to incorporate HockeyApp into a new Visual Studio extension I’ve created. Well I published the updated extension a couple of days ago and HockeyApp is already paying dividends.
Here’s the info from HockeyApp at the time of writing:
Build Number Downloads Crashes Last Updated 1.1.0.0 0 119 29 Jul 2016, 10:15 1.0.0.0 0 8 26 Jul 2016, 21:54 HockeyApp can provide a way to deploy applications, but that isn’t relevant to Visual Studio extensions, which is why the ‘Downloads’ column is zero. So you can see there’s a bunch of crashes (aka exceptions) that my extension is experiencing. Now I’m pretty sure that these wouldn’t be really crashing Visual Studio, but they would be affecting how well the extension works.
There’s now a number of issues created in the Github repo for me to review:
- Fix crash in Microsoft.VisualStudio.Diagnostics.Common.Check.Throw[XT]
- Fix OverflowException in System.Convert.ToUInt32
- Fix AggregateException in Microsoft.CodeAnalysis.Workspace.CheckDocumentIsInCurrentSolution
- Fix AggregateException in Microsoft.CodeAnalysis.Workspace.CheckProjectIsInCurrentSolution
- Fix AggregateException in Microsoft.VisualStudio.Alm.Roslyn.Server.RemoteInterop.RemoteProjectInfo.ToProjectInfo
- Fix AggregateException in Microsoft.VisualStudio.Alm.Roslyn.Server.OutOfProcessWorkspaceServer.FindReference
- Fix AggregateException in System.IO.__Error.WinIOError
- Fix AggregateException in System.Threading.CancellationTokenSource.ThrowObjectDisposedException
- Fix crash in
Microsoft.PowerToolsEx.BlockTagger.Implementation.CsharpVBBlockParser.<GetandParseSyntaxNodeAsync>d\_\_1.MoveNext
- Fix XmlException in System.Xml.XmlTextReaderImpl.Throw
- Fix crash in System.Threading.Tasks.Dataflow.Internal.Common.InitializeStackTrace
- Fix AggregateException in JetBrains.Application.InterruptableActivityCookie.CheckAndThrow
A bit of work for me to do now 😀 Hopefully not too much - I suspect a few of can all be handled in a similar way. Interesting too to see all the different ways your own code can interact with other parts of both Visual Studio and other extensions!
Actually after a bit of investigation, I have a theory that most of these exceptions are nothing to do with me. When I configured HockeyApp, I used the RegisterDefaultUnobservedTaskExceptionHandler(). I suspect this was causing HockeyApp to capture any unobserved Task exception that happened in Visual Studio – not just relating to my extension. I guess if there was a way to get HockeyApp to include only those exceptions based on the extension's namespace that would be more useful.