visual-studio-2010 - NLog nlogger 片段不起作用 Visual Studio 2012

标签 visual-studio-2010 visual-studio-2012 code-snippets nlog

有谁知道如何让 Nlog 的 nlogger 片段像 2010 年一样在 Visual Studio 2012 中工作?我在他们的论坛或互联网上搜索时没有看到任何内容。似乎是使用 Nlog 的人想要回来的东西。

最佳答案

还没有弄清楚如何安装真正的代码段,所以我手动创建了一个代码段来执行与原始代码相同的功能。

在以下文件夹中创建文件 nlogger.snippet:

My Documents\Visual Studio 2012\Code Snippets\Visual C#\My Code Snippets

该文件的内容应如下所示:

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>
                NLog Logger Snippet
            </Title>
            <Shortcut>nlogger</Shortcut>
        </Header>
        <Snippet>
            <Code Language="CSharp">
                <![CDATA[private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

希望这有助于某人。

关于visual-studio-2010 - NLog nlogger 片段不起作用 Visual Studio 2012,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13588131/

相关文章:

c# - 在 VS2010 中运行测试项目的 Microsoft.Web.Administration 出现 ReflectionTypeLoadException

c++ - C++ : Visual C++ mangles method signature differently from mangled method in dll 中 Unresolved external 问题

PHP:如何以给定格式转换这句话

performance - 是否有用于在 Sublime Text 中创建片段的键盘快捷键?

.net - Web 角色中的 app.config 未复制到 Azure SDK 1.8 和 Visual Studio 2010 中

c++ - Qt 4.8 与 Visual Studio 2010 的链接错误

vb.net - 为什么我无法在 vb.net Visual Studio 2010 中声明应用程序事件?

c# - 在我的控制台应用程序中调用 Entity Framework 类

c++ - LNK2019 构建 ZeroMQ Hello World 示例时出错。 VS2012 遥控

textmate - 获取不带扩展名的文件名,textmade 捆绑编辑器