版本6.0有一个新功能nameof,但我无法理解它的目的,因为它只需要变量名称并在编译时将其更改为字符串.
我认为它在使用<T>时可能有一些用途,但是当我尝试nameof(T)它时只打印一个T而不是使用的类型.
有意的吗?
如何将XElement转换为XDocument?有没有内置的方法呢?我能想到的唯一方法就是没有new XDocument(xelement.ToString())它会导致创建大字符串然后解析它们,从而降低性能.
我试图在x64项目上运行intellitest(为此我甚至尝试创建简单的64x项目)
public class Program
{
public static void Main(string[] args)
{
if(args == null)
throw new Exception("test");
}
}
Run Code Online (Sandbox Code Playgroud)
但由于某些原因,我得到的是intellitest输出
saving all files
building project
Launching exploration
starting...
preparing monitored process for 'C:\Users\User\Documents\Visual Studio 2012\Projects\Unitest\ConsoleApplication9\bin\Debug\ConsoleApplication9.exe'
failed to prepare process for assembly 'C:\Users\User\Documents\Visual Studio 2012\Projects\Unitest\ConsoleApplication9\bin\Debug\ConsoleApplication9.exe'
monitored process exited with error while loading assembly (-1006 - 0xfffffc12)
finished
Run Code Online (Sandbox Code Playgroud) 我试图获取我的应用程序的内存使用但由于某种原因我得到的大小不同于任务管理器
我在用:

任务管理器显示我的应用程序占用45mb,而当我在我的代码中拉动它时我得到85mb我怎么能得到与任务管理器相同的大小(不使用wmi)
c# ×4
.net ×2
c#-6.0 ×1
intellitest ×1
linq-to-xml ×1
memory ×1
nameof ×1
process ×1
ram ×1
unit-testing ×1
xelement ×1
xml ×1