开发者

Activator.CreateInstance(string assemblyName,string typName) in silverlight windows phone 7

I want to use Activator.CreateInstance(string assemblyName,string typ开发者_如何学PythonName) (http://msdn.microsoft.com/en-us/library/d133hta4%28v=VS.100%29.aspx) in my Windows Phone 7 app. But it doesn't seems to work.

Any ideas of solutions or work arounds?


You've referenced the .net 4.0 (full framework) in your question. I think you want the Silverlight version: http://msdn.microsoft.com/en-us/library/system.activator.createinstance(v=VS.95).aspx

There isn't a version which matches the signature you're trying to use in Silverlight. You need to pass a Type and, optionally, any parameters the constructor of that type takes.

On the phone you can't load an assembly this way, only a type.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜