Content root for Rider

I'm working on a project that was originally created with Visual Studio. In this project I have some less files that are compiled into css. I get errors in the less where I'm defining custom fonts:

@font-face {
font-family: 'TestFont';
src: url('/webfonts/test_rg.woff2') format('woff2'),
url('/webfonts/test_rg.woff') format('woff'),
url('/webfonts/test_rg.ttf') format('truetype');
}

The error says something like the directory doesn't exist. I think that I need to be able to configure where the content root is. In Webstorm this can be done in a "Directories" option in the settings. I don't see this option in Rider. Does anyone have any ideas?

5 comments
Comment actions Permalink

Hi,

Where is the 'webfonts' directory is placed (absolute path)? What is the absolute path of your solution?

Could you please clarify if placing "webfonts" directory in the solution root could fix the issue?

 

Kind regards,

Sofia.

0
Comment actions Permalink

Sofia Byzova I confirm there is a problem with content root in css (and also scss) files. To reproduce this issue just create a new ASP.NET Core Web Application, create a new "img" folder in wwwroot (should be a content root), place any image file. Then open site.css from css folder and put some reference to this newly created image file. For example, set a background-image in body like this:

body {
margin-bottom: 60px;
background-image: url("/img/snippet.jpg");
}

The path will be red underlined and error will appear: "Cannot resolve directory 'img'". If you change path to "img/snippet.jpg", error disappears, but this path becomes unreachable.

0
Comment actions Permalink

Hi,

Thank you for such a detailed description. I reproduced it and found out that is is a known bug: https://youtrack.jetbrains.com/issue/WEB-46365.

0
Comment actions Permalink

Sofia Byzova the issue is different than the one in the linked issue, here the problem is that Rider does not provide any option to configure Content Root folders. The linked WebStorm ticket may be called a bug because the setting exists, but for rider the setting does not even exists. Any update on when this is going to be fixed? 

0
Comment actions Permalink

As far as I can see, it has not been scheduled for any release yet. 

0

Please sign in to leave a comment.