Conflict with mono.cecil.dll

I have another utility installed on my computer that has a newer version of mono.cecil.dll (0.9.5), and as a result I am getting errors while building in VisualStudio with UnityVS generated projects. Does anyone know of a workaround for this?

Here is a sample error message (there are several of these)…
First a warning, which provides the real clues
4>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3275: The primary reference “UnityEditor” could not be resolved because it has an indirect dependency on the assembly “Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756” which was built against the “.NETFramework,Version=v4.0” framework. This is a higher version than the currently targeted framework “.NETFramework,Version=v3.5,Profile=Unity Full v3.5”.

Then an error
4>D:\tablet\IL_Activities\Assets\Editor\Build.cs(2,7,2,18): error CS0246: The type or namespace name ‘UnityEditor’ could not be found (are you missing a using directive or an assembly reference?)

I found that there are multiple versions of mono.cecil.dll installed on my machine. What it should be building with is the one in unity 3.5 directory which is version 0.6.9.0, but instead it is finding the 0.9.5.0 installed somewhere else.

Thanks,
Cary

This looks to be an issue in how Visual Studio is resolving the references of UnityEditor.

Do you have a Mono.Cecil.dll built for .net 4.0 in your project?

No, not in my project. There is a mono.cecil.dll for 4.0 in the gac, which is where I assume it is getting it from.

I found I can work around this by placing the right mono.cecil.dll in the Library/UnityAssemblies directory under my Unity project. Since this directory is created by Unity, I’d prefer a solution that would work better with my source control - some config setting or something to tell it to look in the right place, or copy to where it needs to be.