Resharper and ASP.NET

i've seen other threads dealing with at least parts of this problem so we (our project team) sure are not the only ones encountering it. but since i've never found a satisfying answer over months now i'd like to start a new thread for this.

in (almost) every webpage resharper (got the newest 259 release) is underlining dozens, sometimes hundreds of errors in code that is absolutely correct and compiles just fine. this includes the use of any user controls as well as the use of functionality from a referenced class library. this already starts at the top where resharper underlines the using statements as invalid and continues throughout the pages and controls underlining every use of a non asp-native user or server control (declared in the aspx/ascx file). i attached a screenshot - and let me add that the solution in the screenshot compiles with no errors.

concerning class libraries i know about a bug with public generic methods (but of course avoiding them is not an option); concerning user controls i have no information at all. all i can say is that we are doing casual asp.net development and resharper can't handle it at all.

now of course you can't work with 600 to 700 errors highlighted on one page with 1000 lines of code, so we turned of this function. unfortunately reformating and refactoring the code doesn't work properly eighter - so resharper currently is totally useless.

what i'd like to know is whether there's something we're doing wrong or if this is a know issue and if it is, when it's going to be solved. as a web developer i need resharper to work properly with asp.net - otherwise i'll have to get rid off it.



Attachment(s):
resharper.jpg
15 comments
Comment actions Permalink

First of all, thank you for your feedback, but to deal with your problem we
need some details.

It looks like one of the referenced assemblies is not found. How do you
reference the missing assembly?

It would help as a lot if you could send us the solution, that illustrates
the problem. If you cannot send us your working solution, could it be
possible to create a small sample?

You may send it to me directly qx at jetbrains dot com.

Thanks in advance.

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

i have attached a sample solution that illustrates the two problems:

1. user controls are not recognized
2. classes from referenced assemblies are not recognized

i included another screenshot (in the root of the zip) that shows you exactly what's on my screen. as a matter of fact resharper reports 5 errors in a page with 3 lines of code (!).

let me add some more information:

to 1: i think the point here is that we are referencing the user controls with web.config entries; this is a fine enhancement in asp.net 2.0 but it seems that resharper can't handle it.

to 2: as i reopened the sample solution, these errors were gone at first. i then made any change to the class library and recompiled - and the errors were back. it seems that the problem here is the public generic function.

i hope you can reproduce the behaviour and would be glad if you could solve the problems.

best regards
sr



Attachment(s):
ResharperDemo.zip
0
Comment actions Permalink

Thanks a lot.
It looks like we have broken direct reference to the control this in one of
the recent builds. TagPrefix mapped to a namespace works now.
We'll fix the problem ASAP.

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"srudin" <no_reply@jetbrains.com> wrote in message
news:10590005.1157629955256.JavaMail.itn@is.intellij.net...
>i have attached a sample solution that illustrates the two problems:
>

1. user controls are not recognized
2. classes from referenced assemblies are not recognized

>

i included another screenshot (in the root of the zip) that shows you
exactly what's on my screen. as a matter of fact resharper reports 5
errors in a page with 3 lines of code .

>

let me add some more information:

>

to 1: i think the point here is that we are referencing the user controls
with web.config entries; this is a fine enhancement in asp.net 2.0 but it
seems that resharper can't handle it.

>

to 2: as i reopened the sample solution, these errors were gone at first.
i then made any change to the class library and recompiled - and the
errors were back. it seems that the problem here is the public generic
function.

>

i hope you can reproduce the behaviour and would be glad if you could
solve the problems.

>

best regards
sr



0
Comment actions Permalink

You may find a new build with the fix at
http://www.jetbrains.net/confluence/display/ReSharper/Download

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

first of all let me thank you for your hotfix. i have downloaded and installed it and here are the results:

it seems that release 260 has fixed problem nr. 1: the user controls are now getting recognized and thus the errors have been reduced by about a third.

unfortunately problem nr. 2 has not been fixed yet; so i'm still getting a couple of hundred errors per page. please note the attached screenshot where you can see that the "using Garaio.Rooms.Web;" statement at the top is marked as an error while the "txtBezeichnungDE" reference at the bottom of the screenshot has resharper saying: "Module 'Garaio.Rooms.Web" should be referenced" (!).

you can easily reproduce this behaviour by opening the demo solution that i have already uploaded about two posts ago. please note that after opening the solution everything works fine - but as soon as you make any change to the class library class "BasePage" (just insert a new line!) and recompile the solution - pang, the errors are there.

we're getting closer and i'm hoping you can fix these errors as well... i'm looking forward for your reply, thanks in advance.



Attachment(s):
errors.jpg
0
Comment actions Permalink

I tried to play with the solution, You've sent us, but - no luck. Everything
works as it should :(

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"srudin" <no_reply@jetbrains.com> wrote in message
news:7378637.1157810154804.JavaMail.itn@is.intellij.net...

first of all let me thank you for your hotfix. i have downloaded and
installed it and here are the results:

>

it seems that release 260 has fixed problem nr. 1: the user controls are
now getting recognized and thus the errors have been reduced by about a
third.

>

unfortunately problem nr. 2 has not been fixed yet; so i'm still getting a
couple of hundred errors per page. please note the attached screenshot
where you can see that the "using Garaio.Rooms.Web;" statement at the top
is marked as an error while the "txtBezeichnungDE" reference at the bottom
of the screenshot has resharper saying: "Module 'Garaio.Rooms.Web" should
be referenced" .

>

you can easily reproduce this behaviour by opening the demo solution that
i have already uploaded about two posts ago. please note that after
opening the solution everything works fine - but as soon as you make any
change to the class library class "BasePage" (just insert a new line!) and
recompile the solution - pang, the errors are there.

>

we're getting closer and i'm hoping you can fix these errors as well...
i'm looking forward for your reply, thanks in advance.



0
Comment actions Permalink

i've played around with the solution as well and tried to figure out what exactly causes resharper to fail. i was able to reduce the error to one specific code change - you're not gonna believe this...

take the demo solution (in its initial state); you should find a "Default" page in the web app and a "BasePage" in the class library. open the "Default" code behind - everything looks fine. close the editor. now open the "BasePage" and insert a new line after the return (as shown in screenshot 1). close the editor. rebuild the solution. open the "Default" code behind - there are the errors (screenshot 2). close the editor again. you may now undo the previous steps and resharper works fine again, then redo the change and it fails - it does seem to be that new line that provokes the errors...

i have this behaviour in about 80-90%. sometimes it only occurrs after rebuilding the solution twice. sometimes it shows up even when the editor remains open, sometimes it only occurrs when i close the editor (as described).

this behaviour doesn't make a lot of sense to me - can you reproduce it? can you explain it? and... can you fix it? :)



Attachment(s):
1.jpg
2.jpg
0
Comment actions Permalink

WooHoo! Thanks Srudin, I just got back from vacation, noticed your post, downloaded version 260 and most of the problems with ASP.NET 2.0 seem to have gotten fixed. Looking forward the next few builds to resolve the last bits and pieces. Thanks JetBrains!

0
Comment actions Permalink

Maybe I spoke a little too soon. I'm still getting some fields marked red in an ascx.cs file. The fields marked in red in my ascx.cs file are tablerow ids in my ascx file. It has definitely improved but it looks like you guys have a bit more work to do.

0
Comment actions Permalink

Modena,

Could You create a small sample for us? I guess, the problem lies in the
server control, that contains tablerow.
Thanks in advance.

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

It looks like the issue is fixed. Try new build, please. You may find it in
its typical location at
http://www.jetbrains.net/confluence/display/ReSharper/Download

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Sergey, it seems like build 261 addressed my issue for now except I have discovered one more additional bug. If I have a page named FOO.aspx and and class named FOO (which is in some namespace say MyNamespace.Types), when I refer to one of FOO's (the class) properties in one of my other pages like FOO.ClassProperty, Resharper thinks I'm refering to the aspx page FOO rather than the class but the compiler resolves it properly and compiles. If I fully resolve FOO's namespace in the reference, it resharper stops complaining. Can you please look into it?

0
Comment actions Permalink

modena,

Sounds nice. Could you create a small sample solution - there are too many
options how using directives are organized and organized.

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

yes indeed - build 261 is a major improvement and has cleared almost any of the so far diplayed errors! great sergey, thanks!

i will post other minor errors in new threads and close this one for now.

0
Comment actions Permalink

260 didn't do squat for me, but 261 is like voodoo magic. Its the first build I can run in my asp.net project since build 253. I'm so excited that i can have the performance enhancements introduced after 253! When I type now, the keys and intellisense keep pace with my fingers. It seems to have fixed problems with circular references also. This is super good.

I can finally dump my demo of JustCode! and go back to R#...

0

Please sign in to leave a comment.