相比于我的机器为什么Uri.EscapeDataString回到我的CI服务器上不同的结果? [英] Why does Uri.EscapeDataString return a different result on my CI server compared to my development machine?

查看:218
本文介绍了相比于我的机器为什么Uri.EscapeDataString回到我的CI服务器上不同的结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的台式机,我得到这个。

On my desktop machine, I get this..

VAR的结果= Uri.EscapeDataString(zdskjhf和放大器; * ^ 65sdfh /.& LT;> \\ SDF); //结果== zdskjhf%26%2A%5E65sdfh%2F%3C%3E%5Csdf

var result = Uri.EscapeDataString("zdskjhf&*^65sdfh/.<>\\sdf"); // result == zdskjhf%26%2A%5E65sdfh%2F.%3C%3E%5Csdf

现在,我的CI服务器的部分的结果上,而不是连接codeD .... 我得到这个

Now, on my CI server part of the result is NOT encoded.... I get this

\\结果== zdskjhf%26 *%5E65sdfh%2F%3C%3E%5Csdf

注意在星号中的第二个结果的中间?在第一个结果,它变得EN codeD。

Notice the asterisk in the middle of the second result? in the first result, it's getting encoded.

任何人能解释这是怎么回事,好吗?

Can anyone explain what's going on, please?

下面是一个.NET小提琴这是使用.NET 4.5,显示星号是EN codeD。 ..

Here's an .NET Fiddle which is using .NET 4.5 and shows the asterisk is encoded...

那么,这是否意味着我的机器 .NET小提琴都的错误的?或者,我们都是正确的,CI服务器是错误的?

So does this mean my machine and .NET Fiddle are both wrong ? Or we are both right and the CI Server is wrong?

这是构建服务器的一些诊断信息..
微软(R)生成引擎版本12.0.30723.0 [Microsoft .NET框架,4.0.30319.34209版] 版权所有(C)微软公司。版权所有。

Some diagnostic info from the build server..
Microsoft (R) Build Engine version 12.0.30723.0 [Microsoft .NET Framework, version 4.0.30319.34209] Copyright (C) Microsoft Corporation. All rights reserved.

(我也不太清楚如何得到这个信息,我的本地开发的机器。这是win8.1 + VS 2013更新3。)

(i'm not too sure how to get this info, for my local dev machine. It's win8.1 + VS 2013 Update 3.)

所有项目都是.NET 4.5 ... 不可以 4.5.1

All projects are .NET 4.5 ...not 4.5.1

我决定运行在所有的.NET框架此code(这个问题)。 这里的结果。

I've decided to run this code on all the .NET frameworks (that matter). Here's the results.

Data:     abcde *.(.)."

.NET 2.0: abcde%20*.(.).
.NET 3.0: abcde%20*.(.).
.NET 3.5: abcde%20*.(.).
.NET 4.0: abcde%20*.(.).

-- MSDN NOTES: Bug now fixed here --

.NET 4.5:   abcde%20%2A.%28.%29.
.NET 4.5.1: abcde%20%2A.%28.%29. 
.NET 4.5.2: abcde%20%2A.%28.%29. 
.NET 4.5.3: abcde%20%2A.%28.%29.

这则提示

  • &LT; .NET 4.5 ,这些值都没有连接codeD。 KEWL,挺好的。
  • > = .NET 4.5 这些值连接codeD。
  • < .NET 4.5, those values are NOT encoded. Kewl, fine.
  • >= .NET 4.5 those values ARE encoded.

链接:这是一个类似SO质疑
。 REF:这是从CI服务器,其中包括大量的调试信息构建结果..

LINK: this is a similar SO question.
REF: this is the build result from the CI server which includes lots of debug info...

推荐答案

。NET 4.5改变了这种方法的行为。搜索的逃跑的。

这篇关于相比于我的机器为什么Uri.EscapeDataString回到我的CI服务器上不同的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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