Enabling WarningAsError causes CS8012 for an x64 project referencing AnyCpu
If you have an x64 project reference an AnyCpu project and turn on warning as error you'll get a CS8012 error. This is inconsistent since CS8012 doesn't fire as a warning and the same projects will build in VS 2013 without issues.
@gafter CS8012 this seems like a compiler error - is this a breaking change in the compiler since 2013?
Assigning to compiler team for investigation
@MsDerekMa I tried reproing this locally and was unable to do so. Here is the setup I used:
- Created a class library with an AnyCPU target
- Created a console app targeting x64
- Add a reference from console app to class library
At this point the solution builds without any errors or warnings.
Is there something I missed in my setup that would help repro this bug?
Closing for now. Please ping back if you can help us out with reproducing this issue.
Sorry about the delay. Our actual scenario is that we are building an x64 test library that is referencing some Any CPU exes, which is the key. Those assemblies are building as AnyCPU with the prefer 32-bit flag set.
It turns out that moving to RTM we are now actually getting the Warning if we don’t have Warnings as error set. But building using VS 2013 we are not getting the warning or the error.
I can send a min-repro zip if you tell me the best way. However, the full setup is an AnyCPU console app building with the Prefer 32-Bit flag set. And having another project referencing that assembly that is x64.