-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Using @inherits and @model together gives intellisense errors #3243
Comments
@rynowak Where is the |
In |
I think we intended to ask: what does the |
Just a POCO |
The change made as part of #3185 didn't work because we do a case sensitive comparison to determine if a file is a |
Why is VS changing the case of the file? That doesn't sound right... |
Umm, that still sounds wrong, no? Intentional or otherwise... The casing of files matters, even on Windows, because NTFS is a case-preserving file system. |
If you say so. @ToddGrun, any chance we could fix this in tooling so that the path casing is preserved? |
We could, it's just a bit of an annoyance as the case we were addressing is due to the git scc provider in VS giving us back the wrong casing. It's surprisingly non-trivial to get the proper case, but we could do that. |
Seeing that this is a design time behavior, I think its ok for us to be case invariant (the fix I made). The worst thing that happens is that you get an extra |
I would think that if there's a problem with the git scc provider that the casing stuff could be kept just for that area of the code, no? What is the relationship between code that interacts with scc providers and code use for the design time host? |
We don't interact with it directly. If I'm remembering correctly, the scc provider notifies the diff window of the file name (incorrectly cased). This case is then passed into when our razor document is created and thus we used to just pass this name over directly to the host. We get the project root from a different mechanism which appears to always return back correct casing. I started investigating modifying the path to get the correct case, but at the time (after consulting with Taylor), it was determined that mvc/razor only needed consistent casing for this scenario, not necessarily correct casing. |
This is still a problem for me. While it's actually working when I run the application, it has some intellisense problems. I've a base class like that: public abstract class MyDemoRazorPage<TModel> : RazorPage<TModel>
{
//...some methods...
} First intellisense problem is in _ViewImports.cshtml: TModel is red, as you see. Second one is in views. It does not regocnize base methods. But it properly works when I run the application. Do you have an idea? Can that be related to Resharper (I'm using Resharper Ultimate 2016.2 EAP 2, built on 02 July) Also note that I'm using latest RTM of AspNet Core (from here: https://dotnet.myget.org/gallery/aspnet1) and just upgraded to latest .net cli. |
Create a 'base' page
Add this to
_ViewImports.cshtml
You'll get squiggles and errors. Eventually the line will stop being colorized by intellisense (try building, and reopening the file).
The text was updated successfully, but these errors were encountered: