我无法使用最新 (5/1/2015) 版本的 Visual Studio 2015 RC 14.0.22823.1 D14REL 诊断依赖问题。
以下代码未编译并引发此错误:
Severity Code Description Project File Line
Error CS1061
'Thread' does not contain a definition for 'CurrentCulture' and no
extension method 'CurrentCulture' accepting a first argument of type
'Thread' could be found (are you missing a using directive or an assembly
reference?)
ServiceLibrary.DNX Core 5.0
using System;
using System.Globalization;
using System.Threading;
namespace ServiceLibrary
{
public class CultureService
{
public void SetCulture(string cultureCode = "fr-FR")
{
Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureCode);
}
}
}
将鼠标悬停在 CultureInfo Visual Studio 上会显示一个弹出窗口,其中显示:
这是project.json
{
"version": "1.0.0-*",
"description": "",
"authors": [ "" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"dependencies": {
"System.Threading": "4.0.10-beta-22816",
"System.Threading.Thread": "4.0.0-beta-22816",
"System.Globalization": "4.0.10-beta-22816"
},
"frameworks": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"System.Collections": "4.0.10-beta-22816",
"System.Linq": "4.0.0-beta-22816",
"Microsoft.CSharp": "4.0.0-beta-22816",
}
}
}
}
我希望有人能帮忙看看问题出在哪里。
谢谢