Unity,Dll上的WebServices,与.Net 4.0兼容 [英] WebServices on Unity, Dll, compatibility with .Net 4.0

查看:139
本文介绍了Unity,Dll上的WebServices,与.Net 4.0兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试统一使用Web服务. 我使用svcutil生成了一个代理类,但是该代理类使用的是"System.Threading.Tasks".

I'm trying to use web services on unity. I used svcutil to generate a proxy class, however the proxy class was using "System.Threading.Tasks".

我注意到System.Threading.Tasks在.Net 3.5上不可用. 因此,我进入了播放器设置,然后将更改为.Net 4.x

I noticed that System.Threading.Tasks wasn't aviable on .Net 3.5. So I went to player setting and I changed to .Net 4.x

但是现在我还有另一个问题,我找不到解决它的方法,我需要使用System.Web.dll和System.Web.Services.dll来使我的Web服务正常工作,但是,包含在Program Files \ Unity \ Editor \ Data \ Mono \ lib \ mono \ 2.0中都是.Net 3.5的所有目标./a>

But now I have an other issue, and I cannot find a way to fix it, I need to use System.Web.dll and System.Web.Services.dll to make my web service work, however, the dll that are include in Program Files\Unity\Editor\Data\Mono\lib\mono\2.0 are all targets for .Net 3.5.

所以这意味着我不能在.Net 4.x上使用它们

So that mean I cannot use them on .Net 4.x

我一直在寻找安静的地方,无法找到任何答案. 如果需要,我可以将代码添加到代理类中,但是我认为这没有用.我应该在某个地方下载那些dll吗? 有人在某个地方见过这些问题吗?

I've been looking for quiet long and was unable to find any answer. I can add the code to the proxy class here if it's require, but I don't think it would be useful. Should I download those dll somewhere? Anyone ever seen thoses issues somewhere?

推荐答案

您使用了错误的dll版本.

You are using the wrong dll version.

Api Compatibility Level更改为Net 4.x后,必须将System.Web.dllSystem.Web.Services.dll文件从<UnityInstallationDirectory>\Editor\Data\MonoBleedingEdge\lib\mono\4.5复制到您的<Project>\Assets路径.

Once you change Api Compatibility Level to Net 4.x, you have to copy the System.Web.dll and System.Web.Services.dll files from <UnityInstallationDirectory>\Editor\Data\MonoBleedingEdge\lib\mono\4.5 to your <Project>\Assets path.

就是这样.重新启动Visual Studio和Unity.

That's it. Restart Visual Studio and Unity.

这篇关于Unity,Dll上的WebServices,与.Net 4.0兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆