microsoft / VSProjectSystem

Documentation for extending Visual Studio with new types of projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NullReferenceException when rule description is not specified

jp2masa opened this issue · comments

I have a rule for Content which extends the one defined in the .NET project system. I removed the description from the rule, as I thought it would inherit the value from the original rule, but it throws a NullReferenceException instead. This means that, if I want to keep the translations working for the rule description, I need to duplicate the localization files from the .NET project system, which doesn't make sense...

Also, I think it would make more sense to make the description optional.

Repro

I didn't test it, but this should be enough to repro:

<?xml version="1.0" encoding="utf-8"?>
<Rule Name="Content"
      PageTemplate="generic"
      OverrideMode="Extend"
      xmlns="http://schemas.microsoft.com/build/2009/properties">
</Rule>

Actually, the problem is different, it's related to the Project context (which seems to be really problematic, it's the second time I find a weird behavior because of that). I had to add the DataSource to the extension, although it should inherit it from the original rule...