Quantcast
Channel: Network Audit and Documentation, CENTREL Solutions Blog
Viewing all articles
Browse latest Browse all 433

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

$
0
0
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.



<CodeSnippetFormat="1.0.0">
  <Header>
    <Title>Add collection editor attribute</Title>
    <Shortcut>coledit</Shortcut>
  </Header>
  <Snippet>
    <CodeLanguage="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.

Viewing all articles
Browse latest Browse all 433

Trending Articles