How to make external annotations work in R#5

Hi everyone,

I'm trying to make the most simple example of external annotations work but it still doesn't show any warnings. I tried using the example from http://msmvps.com/blogs/peterritchie/archive/2008/07/21/working-with-resharper-s-external-annotation-xml-files.aspx which did not work. Here is the code I use:

using System;

namespace MyNamespace
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string parameter = null;
            Console.WriteLine(MyClass.GetLength(parameter));
        }
    }
}

using System;

namespace MyNamespace
{
    public class MyClass
    {
        public static int GetLength(string myString)
        {
            if(myString == null)
                throw new ArgumentNullException("myString");
            return myString.Length;
        }
    }
}

<assembly name="MyNamespace" Version="1.0.0.0">
  <member name="M:MyNamespace.MyClass.GetLength(System.String)">
    <parameter name="myString">
      <attribute ctor="M:JetBrains.Annotations.NotNullAttribute.#ctor" />
    </parameter>
  </member>
</assembly>

Pretty simple, but it does not work.This is what I've tried so far:

- Naming the XML file "MyNamespace.xml", "MyNamespace.ExternalAnnotations.xml" and "MyNamespace.1.0.0.0.Contracts.xml"

- Placing the XML file in "C:\Program Files (x86)\JetBrains\ReSharper\v5.1\Bin\ExternalAnnotations\MyNamespace" and in the same directory as the MyNamespace.dll

Can anyone see the problem in this example?

Please sign in to leave a comment.