Confusing "Cannot resolve symbol" message

Hello,
Im currenty evaluation the aktual ReSharper Version 5.1 Build 5.1.1766.4 in combination with VS2010.
However most of the Features I want to use are working but I got confused after seeing lots of "Cannot resolve symbol" Messages after running "Find Code Issues".

The code is working fine an most of the errors looks like ReSharper Bugs or I do not understand what ReSharper wants from me.
Here is an Example:
The Error is only in the throw new ArgumentOutOfRangeException line telling me that Resharper cannnot resolve the Symbol "CachingTimeSeconds".
Well why?  This is a normal string how can ReSharper not resolve a simple string, that realy is confusing me.

[Bindable(true)]

Category("Misc")]
          [DefaultValue(600)]
          public int CachingTimeSeconds
          {
               get
               {
                    if (ViewState["CachingTimeSeconds"] == null)
                    {
                         ViewState["CachingTimeSeconds"] = 600;
                    }
                    return (int)ViewState["CachingTimeSeconds"];
               }
               set
               {
                    if (value < 100)
                    {
                                        //Cannot Resolve Symbol 'CachingTimeSeconds'
                         throw new ArgumentOutOfRangeException("CachingTimeSeconds", "Der Wert muss größer oder gleich 100 sein.");
                    }
                    ViewState["CachingTimeSeconds"] = value;
               }
          }



Tanks for Help
Michael

1 comment

Hello Michael,

According to MSDN documentation the ArgumentOutOfRangeException(string, string)
constructor expects the name of the method parameter (which is out of range)
as the first parameter. In your example there's no method parameter with
name "CachingTimeSeconds", so ReSharper warns you that you might be using
the ArgumentOutOfRangeException constructor incorrectly. For sure, the error
message is somewhat misleading and we're considering to change it in one
of the future releases. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hello,
Im currenty evaluation the aktual ReSharper Version 5.1 Build
5.1.1766.4 in combination with VS2010.
However most of the Features I want to use are working but I got
confused after seeing lots of "Cannot resolve symbol" Messages after
running "Find Code Issues".
The code is working fine an most of the errors looks like ReSharper
Bugs or I do not understand what ReSharper wants from me.
Here is an Example:
The Error is only in the throw new ArgumentOutOfRangeException line
telling me that Resharper cannnot resolve the Symbol
"CachingTimeSeconds".
Well why?  This is a normal string how can ReSharper not resolve a
simple string, that realy is confusing me.

          [Category(
"Misc")]
          [DefaultVa
lue(600)]
          public int
CachingTimeSeconds
          {
           &nbs
p;   get
           &nbs
p;   {
           &nbs
p;        if
(ViewState["CachingTimeSeconds"] == null)
           &nbs
p;        {
           &nbs
p;           &n
bsp; ViewState["CachingTimeSeconds"] = 600;
           &nbs
p;        }
           &nbs
p;        return
(int)ViewState["CachingTimeSeconds"];
           &nbs
p;   }
           &nbs
p;   set
           &nbs
p;   {
           &nbs
p;        if (value < 100)
           &nbs
p;        {
//Cannot Resolve Symbol
'CachingTimeSeconds'
           &nbs
p;           &n
bsp; throw new ArgumentOutOfRangeException("CachingTimeSeconds",
"Der Wert muss gro?er oder gleich 100 sein.");
           &nbs
p;        }

           &nbs
p;        ViewState["CachingTi
meSeconds"] = value;

           &nbs
p;   }

          }

Tanks for Help
Michael
---
Original message URL:
http://devnet.jetbrains.net/message/5284819#5284819



0

Please sign in to leave a comment.