Visual Studio 2010 Code Snippets fail on VS 2015 with "Object reference not set to an instance of an object"

We've recently had a problem with some old Visual Studio 2010 code snippets written in C# failing when used in Visual Studio 2015 with an "Object reference not set to an instance of an object" error.


It appears that the code snippets now require the title value to be set.



<CodeSnippet Format="1.0.0">
  <Header>
    <Title>Add collection editor attribute</Title>
    <Shortcut>coledit</Shortcut>
  </Header>
  <Snippet>
    <Code Language="csharp">
      <![CDATA[[Editor(typeof(AdvancedCollectionEditor), typeof(UITypeEditor))]]]>
    </Code>
  </Snippet>
</CodeSnippet>



Setting the title will immediately remedy the issue, but another gotcha is....

Any code snippet in the document missing the title element will cause subsequent code snippets to fail.

Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Enable function lock for F1-F12 on HP ZBook mobile workstations