.csproj files are being generated as UTF-16 for Unity Project

Answered

I have Rider 2018.2. Currently it's not doing any code analysis whatsoever, nor syntax highlighting. When i go to the events log i see this:

Project 'Assembly-CSharp' load failed: The project file could not be loaded. There is no Unicode byte order mark. Cannot switch to Unicode

If i change the csproj file encoding to UTF-8, then everything works as expected. However, whenever the project compiles again, the fies are generated as UTF-16 again.

How can i configure the csproj files for them to be generated as UTF-8?

6 comments
Comment actions Permalink

We are also running into this error. We just updated to Rider 2018.2 and Unity 2018.2.5f1 today and are running into this now.

Our work is kind of halted by this bug. Can we have an ETA on a fix?

1
Comment actions Permalink

We downgraded to 2018.1.4 and that fixed the issue for us. Waiting for a fix before upgrading back to 2018.2.

0
Comment actions Permalink

Same here, had to go back to 2018.1.4. I wasn't sure initially if it was the latest update of Unity or Rider, so downgraded Unity back to 2018.2.2f1 as well but that didn't fix the problem on its own.

0
Comment actions Permalink

I had the same problem but seem to have just found a fix. I changed (under Toolset and Build) the field 'Use MSBuild' version so that it reads 'Auto detected'. In my case this maps to '...Unity.app/Contents/MonoBleedingEdge/lib/mono/xbuild/14.0/bin/xbuild.exe'.

What confuses me is that before I made this change, I recall 'Use MSBuild' being specifically set to '14.0'. And yet after discovering the fix if I switch it back to '14.0' it still works (with exe path unchanged)! I'm wondering if the mapped path had somehow become outdated during the version upgrade and switching to 'Auto detected' just happened to re-set it to a correct mapping?

0
Comment actions Permalink

Hi all.

Sorry for the inconvenience. This is a known issue and the fix will be included in Rider 2018.2.1 (coming soon).

Please, see the workaround here.

 

Kind regards, 

Sofia.

0

Please sign in to leave a comment.