c# 01/26/2015

來源:互聯網
上載者:User

標籤:sn   c#   gacutil   

右側欄 project 下properties 點中 再把output改成 class library 會在 ..\bin\Debug 下產生 .DLL 檔案


設定 set up startup project 設定成啟動工程


C:\Windows\Microsoft.NET\Framework\v4.0.30319 下的csc.exe 就是 c#的編譯器


using System; public class Helloworld{               public static void Main(string[] args)                {                               Console.WriteLine("Hello World");                               Console.WriteLine("Enter any key to exit...");                               Console.Read();               }}


developer Command Prompt for vs2012.exe 工具


1.C:\Program Files (x86)\Microsoft Visual Studio 11.0> csc /?

---csc的用法


2.C:\Program Files (x86)\Microsoft Visual Studio 11.0>csc /t:exe /out:C:\Users\jz9

1129\Documents\Visual Studio 2012\temporary\helloword.exe C:\Users\jz91129\Docum

ents\Visual Studio 2012\temporary\helloworld.cs

Microsoft (R) Visual C# Compiler version 4.0.30319.18408

for Microsoft (R) .NET Framework 4.5

Copyright (C) Microsoft Corporation. All rights reserved.


error CS2001: Source file ‘Studio‘ could not be found

error CS2001: Source file ‘2012\temporary\helloword.exe‘ could not be found

error CS2001: Source file ‘C:\Users\jz91129\Documents\Visual‘ could not be found

error CS2001: Source file ‘Studio‘ could not be found

error CS2001: Source file ‘2012\temporary\helloworld.cs‘ could not be found

warning CS2008: No source files specified


C:\Program Files (x86)\Microsoft Visual Studio 11.0>csc /t:exe /out:C:\cstemp\he

lloworld.exe C:\cstemp\helloworld.cs

Microsoft (R) Visual C# Compiler version 4.0.30319.18408

for Microsoft (R) .NET Framework 4.5

Copyright (C) Microsoft Corporation. All rights reserved.



C:\Program Files (x86)\Microsoft Visual Studio 11.0>

可見 路徑裡面不可以有空格


3.>ildasm --反編譯.net的exe和dll檔案


4.> sn /? 產生一對公開金鑰私密金鑰對

在工程--> properties 中 signing --> browser-->加入產生的snk


5.c:\windows\assembly 電腦上所有的公用assembly


6.homework

 --Strong name an assembly

 --Add to GAC

參考資料:

http://www.cnblogs.com/lly001001/archive/2012/05/24/2515930.html

https://msdn.microsoft.com/en-us/library/ex0ss12c(v=vs.110).aspx


c# 01/26/2015

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.