我在制作Windows 8.1商店应用程序。我想设置一个默认目录cashe一些图像和我使用此代码做到这一点:在Windows 8.1应用程序中缺少System.Environment定义
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace YouMaps.Tiles
{
class TileLoader
{
public const string defaultCasheName = "YouMapsTileCashe";
public static string defaultCasheDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "YouMaps");
我得到的是统环境不包含GetFolderPath和SpecialFolder定义错误。我F12'ed超过环境果然,这一切是在那里
#region Assembly System.Runtime.Extensions.dll, v4.0.0.0
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1\System.Runtime.Extensions.dll
#endregion
using System.Security;
namespace System
{
public static class Environment
{
public static int CurrentManagedThreadId { get; }
public static bool HasShutdownStarted { get; }
public static string NewLine { get; }
public static int ProcessorCount { get; }
public static int TickCount { get; }
public static void FailFast(string message);
public static void FailFast(string message, Exception exception);
}
}
然而,当我看到在使用Windows MSDN似乎表明,即使是Windows 8.1应该有机会获得全方位的定义。我使用Google进行搜索,并在堆栈溢出中查看是否有其他人有这个问题,但我甚至没有发现任何东西。所以,这个问题 - 谁能告诉我为什么我的环境“缺少”其定义的90%,其次,我该如何解决它?
哦,这里是我的引用:
.NET for Windows Store apps
Bing Maps for C#, C++, or Visual Basic
Microsoft Visual C++ 2013 Runtime Package for Windows
SharpKml
Windows
感谢您阅读我的问题,并提供帮助。这是我所问过的第一个问题,如果我违反了某些规则礼节或未能包含一些相关信息让我知道。