开发者

Type cant be resolve in UnitTest after migrating Project from vs2005 to vs2010 (MSTest)

We are actually analyzing what we have to do if we migrate our application from VS2005 up to VS2010.


What i have done:

I opened all solutions in VS2010 and let convert vs the projects.

At the moment the production assemblies dont get an upgrade of the .NET Framework, it has to target the framework 2.

The framework version of the unit test assemblies (MSTest) is switched to the version 4 by VS2010 autom开发者_开发技巧atically, thats ok so far.


The Problem: Some unit tests are failing cause they can't access a config file through the ConfigurationMananger.OpenExeConfiguration(ConfigurationUserLevel.None) call.

The following exception is thrown:

System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Type is not resolved for member X ... System.Runtime.Serialization.SerializationException: Type is not resolved for member X

The member X is derived from GenericIdentity and is marked as [Serializable]. All needed files (configuration, assemblies) are up to date and are correctly deployed in the output folder.

I tried to switch the framework version of the production assemblies to version 4, but it didn't help.

I found this ressources, but they dont helped me. post from stack

Anybody has an idea why i get the described behavior?


If i change my Identity from

public MyIdentity : GenericIdentity
{ }

to

public MyIdentity : MarshalByRefObject, IIdentity
{ }

all of my tests are gettin green.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜