将GNU GPL许可证添加到C#App

时间:2009-09-28 13:00:25

标签: c# licensing gpl gnu stylecop

我知道怎么做但我不知道StyleCop方法是真的还是工作的。通常在StyleCop规则中,您必须将此示例添加到标题(需要编辑):

//-----------------------------------------------------------------------
// <copyright file="Widget.cs" company="Sprocket Enterprises">
//     Copyright (c) Sprocket Enterprises. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

使用StyleCop for ReSharper:

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Form1.cs" company="">
//   
// </copyright>
// <summary>
//   Defines the Form1 type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

我的最终标题是:

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Form1.cs" company="{Company}">
//
// Copyright (C) 2009 {Company}
//
// This program is free software: you can redistribute it and/or modify
// it under the +terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/. 
// </copyright>
// <summary>
// {one line to give the program's name and a brief idea of what it does.}
// 
// Email: {Email}
// XFire and Steam: {Username}
// </summary>
// --------------------------------------------------------------------------------------------------------------------

如果我将此标题添加到我的所有来源并分享,我的应用程序是否会获得GPL许可?如果没有,问题出在哪里?我希望StyleCop方法能够运行。也许我应该移动“{一行给出程序的名称并简要了解它的作用。}”高于版权标记。 感谢。

2 个答案:

答案 0 :(得分:3)

有一个how-to将许可证应用于源代码。

这是一个利用代码区域的好机会:

#region Copyright
// your copyright goes here
#endregion

这样开发人员就可以解决所有问题: - )

另外,创建一个snippet,这样您就不必记住了。

答案 1 :(得分:2)

对我来说很好看。您是否阅读了GPL常见问题解答,为您的程序使用GNU许可证有一整节。也许你可以在那里仔细检查。