resharper-unity: Project load failed due to Unicode issue
Hi,
I updated to the Rider 2018.2 release yesterday and now it looks like Rider can no longer open my Unity solution’s projects.
I get these errors in the log: `14:48 Project ‘Assembly-CSharp’ load failed: Die Projektdatei konnte nicht geladen werden. Keine Unicodebyte-Reihenfolgemarkierung. Es kann nicht zu Unicode gewechselt werden. E:\trunk\Assembly-CSharp.csproj at (0:0)
14:48 Project ‘Assembly-CSharp-firstpass’ load failed: Die Projektdatei konnte nicht geladen werden. Keine Unicodebyte-Reihenfolgemarkierung. Es kann nicht zu Unicode gewechselt werden. E:\trunk\Assembly-CSharp-firstpass.csproj at (0:0)
14:48 Project ‘Assembly-CSharp-Editor’ load failed: Die Projektdatei konnte nicht geladen werden. Keine Unicodebyte-Reihenfolgemarkierung. Es kann nicht zu Unicode gewechselt werden. E:\trunk\Assembly-CSharp-Editor.csproj at (0:0)
14:48 Project ‘Assembly-CSharp-Editor-firstpass’ load failed: Die Projektdatei konnte nicht geladen werden. Keine Unicodebyte-Reihenfolgemarkierung. Es kann nicht zu Unicode gewechselt werden. E:\trunk\Assembly-CSharp-Editor-firstpass.csproj at (0:0) `
(Rough translation: “The project file could not be loaded. No Unicode byteorder mark. Can not switch to Unicode.”)
I already tried to invalidate Rider’s caches, removed all Rider data from the Unity project (both .idea in the root as well as the plugin in Assets/Plugins/Editor), tried the “Sync C# Project” from Unity and of course restartet both Unity and Rider.
Anything else I could try? I really need to get this working again to properly continue my work 😃
Regards, Chris
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 5
- Comments: 37 (17 by maintainers)
Commits related to this issue
- fix https://github.com/JetBrains/resharper-unity/issues/727 utf-16/utf-8 problem — committed to JetBrains/resharper-unity by van800 6 years ago
Fix will be included in Rider 2018.2.1.
For a temporary workaround:
Assets\Plugins\Editor\JetBrains\JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll@van800 This solution worked for me. The precise thing you need to do in your Unity project’s
Packages/manifest.jsonis:In other words, add the registry line to ensure you have the staging registry.
Tested in 2018.2.16f and Rider 2018.2.3
I got a comment from Unity team saying:
fixed in0.0.42-preview.26on staging repository.@van800 is correct. XDocument will save with utf-16 by default. A custom text writer can be defined to change this behavior. Like this for example:
@julia-vaseva Just set it back to the autodetected MSBuild and it’s giving the errors again. Restarted Rider to get cleaner logs (looks like idea.log never gets reset though): logs-20180825-132134.zip
@van800 While that might fix the current issue I don’t see why it should be necessary to install all this custom stuff if that was never needed before the 2018.2 build. Unity provides the Mono libraries that Rider should use for lookup anyway (and I think it properly did before, at least never had any errors). So this looks like a “simple” regression on Rider’s side (or becoming more strict about an issue in Unity but even so that should be fixed on Rider’s / Unity’s side and not require the end user to fiddle with stuff 😉 ). Anyway, there’s both a 3.5 and 3.0 in both x86 and normal Program Files and the plugin is installed fine. The Unity preferences for Rider are the same as in your screenshot (it’s not listing any installed .NET versions though in the label). Did the Sync C# Project thing a bunch of times by now but it seems this is a static issue.
Hello, I reproduce on Rider2018.2.3 & Unity2018.2.14f1
I delete JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll and install the dll. https://github.com/JetBrains/resharper-unity/issues/727#issuecomment-416020746
My csproj has
<?xml version="1.0" encoding="utf-16"?>Rider 2018.2.1. is out with fix to this problem. Be sure to install new Rider, open solution in Rider. Rider will install new EditorPlugin Focus Unity and it will reload new EditorPlugin.