![](/img/trans.png)
[英]Running a C# program with command line prompts in Visual Studio Code
[英]Running C# sample code in command line
Newb問題在這里:我正在嘗試從https://developer.leapmotion.com/documentation/Languages/CSharpandUnity/Guides/Sample_CSharp_Tutorial.html運行此示例C#代碼以實現Leap Motion。
運行樣本
要運行示例應用程序:
編譯示例應用程序:在Windows上,確保Sample.cs和LeapCSharp.NET3.5.dll或LeapCSharp.NET4.0.dll位於當前目錄中。 在命令行提示符下運行以下命令(使用您所使用的.NET Framework的正確庫參考):csc /reference:LeapCSharp.NET4.0.dll / platform:x86 / target:exe Sample.cs注意:使用適當版本的.NET框架中的
csc
編譯器。
如何確定我擁有的.NET框架?
如何確保Sample.cs和LeapCSharp.NET3.5.dll或LeapCSharp.NET4.0.dll在當前目錄中? 這只是意味着要將這個文件夾放到我的CD中吧? 然后執行:
csc /reference:LeapCSharp.NET4.0.dll /platform:x86 /target:exe
Sample.cs
有人可以翻譯該行中每個段的實際含義嗎?
在命令行中,輸入dir
以查看當前dir
中的內容。 如果有sample.cs
和相應的.DLL
,則應設置為go。
若要查看您擁有的.NET版本,只需在Visual Studio命令提示符中鍵入clrver
。 僅供參考,如果您看到的是2.0版,在這種情況下實際上就是3.5(.NET 3.5實際上是在2.0編譯器上編譯的,而4.0是完全不同的東西 )。
和命令的細分:
csc // C Sharp Compiler
/reference // Reference a DLL not in the GAC
/platform // Compile for 32bit or 64bit?
/target // Producing a DLL or EXE?
Sample.cs // File to actually compile
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.