I have been struggling to find a good detailed explanation for that anywhere. So I have a project (destined to be deployed to SharePoint) which is organized as follows:
MyProject
12
TEMPLATE
CONTROLTEMPLATES
FEATURES
LAYOUTS
Images
MyImage.png
In a css file somewhere I have the following line:
.myClass { background: url(/_Layouts/Images/MyImage.png); }
Obviously the whole url comes out red and I have a ReSharper error stating:
Path C:\MySolutionFolder\MyProject\_Layouts\Images\MyImage.png not found
So at no point I expect ReSharper to understand anything about SharePoint, I just want to understand how to map folders.
So I went to the project's properties, and created a new mapping:
Substitute /_layouts with C:\MySolutionFolder\MyProject\12\TEMPLATE\LAYOUTS
That does not seem to do anything, so I tried playing around, and the only thing I found to do something is:
Substitute _Layouts with C:\MySolutionFolder\MyProject\12\TEMPLATE\LAYOUTS
Instead of the previous error, I now only have the *_Layouts* part of the url in red, and a new ReSharper error:
Symbol '_Layouts' doesn't exist in CSS 3.0
That does not make much more sense to me, but it is the only thing I found to have any effect. Note that it seems wrong to put this path mapping without the initial slash, because it feels like it would replace the word '_layouts' in any position in the path, when it should only be replaced at the root path of the site.
And also, the fact that the mapping changes the error seems to be case sensitive, something I do not understand for a url path mapping (urls are not case sensitive are they?).
Also, using Ignore instead of Substitute does not make the error disappear. It seems the only way there is is to disable the error, which IMO is really a bad thing.
Behaviour has been reproduced on 6.1 and 7.0.
The project is made for SP 2007 as the 12 suggests, the problem is on VS 2010 (I have not tried any other version).
And if the path mapping is not what I think it is, is there any way around this? A plugin, for instance?
Thanks a lot for your feedback. It looks like the functionality is broken and will be fixed in the bugfix update ASAP. I've created a youTrack issue for the problem http://youtrack.jetbrains.com/issue/RSRP-328783
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With