CSharp Files Are Considered Non Solution Files (Prevents Cleanup and Reformat Actions)

Hello, I'm working on a codebase with lots of projects under one solution and many of the files in the older projects are being color coded as non-solution files (a brown color). This prevents the “cleanup and reformat” action since that only works on solution files which is not great. New projects don't seem to have any issues.

The solution builds and runs just fine, and with the exception of “cleanup and reformat” (and a couple other things) the functionality is still there. I have tried invalidating caches and deleting the .idea folder for a complete reset but no good.

In the image you can see one project's files are all non-solution whereas another project's files are just fine for some reason. Even when I use Rider (version 2023.3) to add a new file to the SkyWire.Pos.Model project, it is still brown colored. Any help would be appreciated, thank you!

2
15 comments

Hi Tylersyme

Could you please check the settings for me? Go to the Elements to skip section of File | Settings | Editor | Inspection Settings and check if there are no unexpected patterns added. 

Also, could you share the SkyWire.Pos.Model.csproj and .sln files? You can upload them to our server and share the ID. Thanks! 

0

Thank you Alexandra,

I think elements to skip looks correct.

Here is the id to those files 2024_01_05_3gMvE17DuUGh64t9RkQ6iA. I have included the SkyWire.Pos.Ordering one as well since it is working correctly, the comparison might help. I've checked these files myself but couldn't find anything that stood out, hopefully you'll see something I can't.

Thanks again!

0

In case this helps, I noticed that the files shows up as brown even though the “Include non-solution items” is unchecked up above in the search window.

 

0

Hi Tylersyme

Thank you for the details! I've created an issue for further investigation. We are not sure the cause of the issue yet and need some more information from you. Please collect the full log bundle. You can upload it directly to the YouTrack issue or use our server once again and share the new ID. Please also check the following: 

- find the .dotsettings file near a solution file and check if any of affected files are present there

- try to open any of the affected files in the editor and press "Alt+Ctrl+shift+8" to enable analysis. 

Please also attach dotsettings file along with the results of the check. 

Thank you for your patience! 

0

Thank you Alexandra, I've uploaded the log zip directly to the YouTrack issue.

I checked the .DotSettings.user file and don't recognize any of the affected files. I've uploaded that file in case someone wants to look at it 2024_01_17_cSZWaPGbpTqosUM4ADU9ot

I tried "Alt+Ctrl+shift+8" with one of the problematic files and it seems to toggle some of the syntax highlighting? Here's a before and after image. Thank you

0

Hi Tyler, 

Thank you for the logs! 

Unfortunately, we need some more information. 

  • please call action Reload project and show logs on the problematic project and share the resulting .binlog file 
  • add the list of the affected files (as full as possible) 
  • check if code highlighting is disabled in the mentioned files (do you see OFF at the right top of the Editor tab?) 

You can add info the same way as before or attach it directly to the YouTrack issue

Thank you for your patience! 

1

I wasn't able to find an action specifically called Reload project and show logs but I went ahead and restarted rider to reset the logs and then reloaded one of the problematic projects afterwards and then retrieved the logs. I've uploaded those new logs to the issue. The name of the project I reloaded is SkyWire.Pos.Module.Orders.

There is a large list of affected files since every file in the reloaded project is affected, but here are a few

OrderManager, OrderExtensions, OrderPreviewView.xaml.cs, SaleFactory, OrderRequester, OrderCreationManager, IOrderRequester, AssemblyInfo, app.config

All of these files are brown colored and do not reformat on save, however all have code highlighting. There is no OFF in the top right of the editor unless I use the "Alt+Ctrl+shift+8" to turn analysis off manually. Even when I add a new file using Rider the color of the file is brown (and syntax highlighting behaves normally)

Thank you for your time! Let me know if you need anything else to help debug this

0

Hi Tyler! 

Thanks a lot for the details. I apologize for the not full steps on how to reload project with logs. This action is available in internal mode only and it collects a completely different type of log. Would you be so kind to try once again? For this

  • run Rider in internal mode
  • right-click on the project once again and choose Reload project and show logs. You will see a notification in the bottom right corner with a link to the created .binlog file or this file will be automatically opened in MSBuild Structured Log Viewer.
  • share the .binlog file with us. 

Thank you for your collaboration and sorry again. 

1

No problem,

That worked and I have uploaded the .binlog file of that reloaded project to the issue. Same project as before so the files I gave should be in there.

Once again let me know if you need any more debugging help, thank you.

0

Are there any workarounds or updates on this?

I've been experiencing the same issue in all 200 projects of a solution. Some devs on my team are experiencing this as well but other devs are not so it seems to be a localized issue. Just wanted to check in and see if there is a solution coming. 

1

Hi Matt Zawislak

Several different reasons could cause this issue. Could you please contact us via Help | Report a bug with logs attached so we can take a closer look at your particular case? Thanks! 

0

I can confirm this happens also to me in multiple projects. I didn't have these sorts of issues in prior versions of Rider. Probably you put too much AI in your products now…

0

Hello Sebastian,

We would appreciate it if you could report your issue to our tracker via Help | Report a bug, so that we can take a dedicated look at it.

Have a nice day!

0

Dmitry Kazantsev  I appreciate the need, and I can report a bug, however I'm not always at liberty to provide necessary files without significant work on my part. I would recommend that you attempt to reproduce especially with complex multi-project CLR/CLI solutions, as that is where I see the problem most often.

0

Hello Sebastian,

Unfortunately, we can't be sure what is the reason for the issue you experience, because such an issue might be caused by different reasons.

So, that, if you could share the initial information about the specific issue you encounter (report a bug or submit a support request), we could investigate it further. Additionally, we would appreciate it if you could share several screenshots that demonstrate the issue.

The possible option you can try is to check the casing in project model dump, .csproj and .sln files:

  • Launch Rider in internal mode;
  • Execute Tools | Internal Actions (Rider) | Dump | IDEA Project Model;
  • Check if problematic files (those that Rider highlights in yellow) are listed in that file generated;
  • Verify on a sample file if its casing (its actual name in explorer) matches with what you see in the project model;
  • Also, please ensure that the casing of .csproj files is correct (.csproj file name written in .sln file matches with file name in file explorer);

Have a nice day!

0

Please sign in to leave a comment.