Project path mapping feature limitations
Hi, I am currently trying to bring down SWA errors in our solution to zero, so that we will be able to fail TC7 build on > 0 error inspections and I ran into several problems. One of the main ones on our solution is broken path's and links for ascx controls:
In the solution we have a shared project that contains bunch of ASP.NET UserControls that are reused in several web projects in the same solution.
Sharing of those controls is implemented by copying over .ascx* files into specific folders of corresponding webprojects as a prebuild action.
At the same time, these .ascx* files are not included into web projects themselves to reduce compilation time (otherwise every time those controls copied over VS tries to recompile whole web project, even if it didnt change).
So, as a result resharper's SWA is complaining about some web.config control tag mappings: "Project file expected at ......".
It turned out that R# 6 had a new feature (I think it's new because it is described HTML section of R# help http://www.jetbrains.com/resharper/webhelp/ReSharper_by_Language__HTML.html) that allowes path remapping for project items. When I tried to use the feature to map web project folder to a folder located in user control library project I got error message stating that: "File or folder is outside the web application".
I am wondering now whether it is design limitation or implementation one, and whether it would be possible to remove it?
P.S. For now I mapped it as ignore path which resolved the issue, it feels wrong though.
Best Regards,
Sergei
Please sign in to leave a comment.
Sergei,
thanks a lot for your feedback. The limitation to process only files that included into the project exists due to technical reasons - we do not process files outside solution because even if we read their content to pick types and properties from them, we won't be able to perform any refactoring that involve such files.
The only thing I'm able to suggest at the moment is just to ignore the paths as you already did.
Hi, thanks for your quick reply.
I think I didn't make myself clear enough in my original post or I got confused with answer :)
All of the files are part of the solution, except for copied over ones - which are duplicates of files that are part of another project of the same solution.
To clarify the question I am attaching a screenshot and sample solution.
My main confusion and the reason why I posted this question was the fact that resharper IS allowing to pick a path that it will not be able to use because its a different project (see screenshot).
Attachment(s):
path remapping.png
MapPathExample.zip
Files that are not included into solution are considered 'out of solution' - you may have reasons to not include them. In the case it's possible to include copied files intho the web application - this will fix R# issues and won't affect compilation.
It looks a bit awkward but it works.