0
votes

We use the CodeDomProvider to compile C# and VB code in our app. We have been using Roslyn ever since it came out for this purpose. We are currently using version 1.0.8 of Roslyn. Recently, we started getting this error:

Metadata file 'C:\Windows\system32\config\systemprofile\AppData\Local\assembly\dl3\8GTGDQKQ.4QR\V42JN801.7NM\36a4366e\f1f27652_1972d301\System.Runtime.dll' could not be found

I'm not adding this reference manually. Roslyn seems to be adding this reference in arbitrarily. I've tried adding a reference to System.Runtime.dll inside our app's bin folder, but the problem does not go away.

I've logged a bug with the repo here, but not response: https://github.com/dotnet/roslyn/issues/24630

Has anyone else seen this bug? Is there a workaround? Why is the compiler looking for System.Runtime.dll at this path? Why won't it just use the DLL inside our bin folder?

1

1 Answers

0
votes

I found a workaround. If I copy the file System.Runtime.dll from my bin folder to the path C:\Windows\system32\config\systemprofile\AppData\Local\assembly\dl3\8GTGDQKQ.4QR\V42JN801.7NM\36a4366e\f1f27652_1972d301 the assembly compiles fine.

So, Roslyn is ignoring the path I am telling it that System.Runtime.dll is in and expecting to find the DLL in a hard coded path instead. This does seem like a bug to me.