NLog Nlogger片段无法正常运行Visual Studio 2012 [英] NLog nlogger snippet not working Visual Studio 2012

查看:79
本文介绍了NLog Nlogger片段无法正常运行Visual Studio 2012的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何像在2010年一样使Nlog的nlogger片段在Visual Studio 2012中工作吗?闲逛时,我在他们的论坛或互联网上什么都没有看到.似乎使用Nlog的人会想要回来的.

Does anyone know how to get Nlog's nlogger snippet to work in Visual Studio 2012 like it did in 2010? I don't see anything on their forum or on the internet when googing around. Seems like something that people who use Nlog would want back.

推荐答案

还没有找到如何安装真实代码段的方法,因此我手动创建了一个代码段,以执行与原始代码相同的功能.

Haven't worked out how to get the real snippet installed, so I manually created a snippet to perform the same function as the original did.

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

Create the file nlogger.snippet in the following folder:

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>

希望这对某人有帮助.

这篇关于NLog Nlogger片段无法正常运行Visual Studio 2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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