Managed target code requires a '\clr' option : Error

不想你离开。 提交于 2021-01-27 05:42:52

问题


When I try to batch build my project, I encounter this error while I have enabled the clr runtime support.

My project can run with no problem and I only receive this error when I try to make a batch build.

I have made a lot of searched in google but most results are about enabling the clr option. I'd like to know how I can fix this problem.


回答1:


This is the kind of problem you'll run into when you make project setting changes while you are debugging your project. Settings are stored per configuration. A common mistake is to make the change for the Debug configuration but forgetting to make the same change for the Release configuration. Kaboom when you then try to get the Release configuration built, as would happen when you use Batch Build.

Go slower. Project + Properties, Configuration Properties, General. Note the combobox labeled "Configuration" in the upper left corner. It probably now says "Active (Debug)". Change it to "Release". And note how the "Common Language Runtime support" setting changes as you flip back and forth. Make them the same, /clr. Use Build + Configuration Manager to make the Release build the default configuration and use Build + Build to build it. Test it.

There might be other settings you've changed that need to be corrected for the Release build as well.



来源:https://stackoverflow.com/questions/16099926/managed-target-code-requires-a-clr-option-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!