Error related to Microsoft.VisualStudio.TestTools.UnitTesting namespace

人走茶凉 提交于 2019-12-24 10:38:27

问题


I am developing a windows store app which take the user input(mathematical question),process it using prolog and output the answer. I have add Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll as an reference to my windows Store app.

I refer https://github.com/SWI-Prolog/contrib-swiplcs/blob/master/TestSwiPl/PlQuery.cs

This reference creates two errors,

1.Cannot resolve Assembly or Windows Metadata file 'System.Configuration.dll'

2.Type universe cannot resolve assembly: System.Configuration, version=2.0.0.0,..

Can I solve this error or Is it not possible to use this as a reference in windows store app. I'm using visual studio 2013.


回答1:


You should not reference the Microsoft.VisualStudio.QualityTools.UnitTestFramework assembly from any production assemblies you're deploying. It should only be referenced from test projects.

Remove the reference and fix any build errors. Move unit tests into a unit test project if that's the root cause. Unit Tests should not be located inside a deployment item.

As for the System.Configuration reference, you likely want v4 not v2.

For this, remove the reference and add a correct reference to v4.

If the System.Configuration reference is not yours, but instead a binding from an assembly you are referencing, you likely need a binding redirect. For reference you may want to review Redirecting Assembly Versions on MSDN.

HTH.



来源:https://stackoverflow.com/questions/28227983/error-related-to-microsoft-visualstudio-testtools-unittesting-namespace

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