Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/323.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 通过控制台接口访问编译器时包括库_C#_Windows_Visual Studio_Console - Fatal编程技术网

C# 通过控制台接口访问编译器时包括库

C# 通过控制台接口访问编译器时包括库,c#,windows,visual-studio,console,C#,Windows,Visual Studio,Console,受示例启发,我决定扩展阶乘类 using System; using System.Numerics; namespace Functions { public class Factorial { public static BigInteger CalcRecursively(int number) { if (number > 1) return (BigInteger)numbe

受示例启发,我决定扩展阶乘类

using System;
using System.Numerics;

namespace Functions
{
    public class Factorial
    {
        public static BigInteger CalcRecursively(int number)
        {
            if (number > 1)
                return (BigInteger)number * CalcRecursively(number - 1);
            if (number <= 1)
                return 1;

            return 0;
        }

        public static BigInteger Calc(int number)
        {
            BigInteger rValue=1;

            for (int i = 0; i < number; i++)
            {
                rValue = rValue * (BigInteger)(number - i);                
            }

            return rValue;

        }      
    }
}
嗯。我缺少一个集合引用。我想“这一定很简单。整个系统应该有两个system.Numerics.dll文件-我需要的是添加到命令/链接:[system.Numerics.dll的x86版本的路径]”。搜索结果冻结了我的灵魂:


正如你所看到的(或不看到的),有比我预测的多得多的文件!此外,它们的大小和内容也不同。我应该包括哪一个?为什么有五个文件,尽管只有两个有存在的意义?/link:命令正确吗?或者我的思维轨迹完全错了吗?

我通常发现

/r:System.Numerics.dll

让编译器只在GAC中找到程序集,这通常是您想要的方式。(前几天我确实需要一个控制台应用程序的System.Numerics…)

奇怪的是,csc的命令手册(“csc/?”)中竟然没有提到这样有用的命令。@kowalt:是的
/r
只是
/reference
的缩写形式。我的超光。无论如何,谢谢你用一种通俗易懂的方式来描述它。
/r:System.Numerics.dll