编译源文件的时候出错处理

I need an object browser with considerable flexibility. I focused on Denis Bauer: | http://www.denisbauer.com/NETTools/FileDisassembler.aspx .NET Reflector. I downloaded the source code and the dll file and tried to compile. I got 121 errorr all of them related to namespaces not found and references missing. using Reflector.CodeModel; gives me and error: Error 1 The type or namespace name 'CodeModel' does not exist in the namespace 'Reflector' (are you missing an assembly reference?) I could not find the dll for this Namespace so far. There are many others but I feel I can probably handle them myself eventually. Thanks.

 

答案:

Just as Chris pointed out, Reflector.CodeModel namespace exists in the assembly Reflector, so you should add the reference to the Reflector.exe. You may download it here:

http://www.aisto.com/roeder/dotnet/

 

Also, after you added the reference to the Reflector.exe, you will still get the compile-time error below:

 

Error 2 Cryptographic failure while signing assembly 'C:/Users/jetan/Desktop/Reflector.FileDisassemblerSources/obj/Debug/Reflector.FileDisassembler.dll' -- 'Error reading key file '../../../DenisBauer.snk' -- The system cannot find the file specified. ' Reflector.FileDisassembler

 

Actually, this is the strong name feature added by Denis Bauer in the AssemblyInfo.cs file. You may just remove the following statement in the AssemblyInfo.cs file to eliminate the error:

//DENISB: If you want to recompile, the following line throws an error. Please just remove the reference to my private key
//or create your own private key with the sn.exe tool
[assembly: AssemblyKeyFile("..//..//..//DenisBauer.snk")]

 

Hope this helps.

 

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Reflector是由微软员工Lutz Roeder编写的免费程序。Reflector的出现使.NET程序员眼前豁然开朗,因为这个免费工具可以将.NET程序集中的中间语言反编译成C#或者Visual Basic代码。除了能将IL转换为C#或Visual Basic以外,Reflector还能够提供程序集中类及其成员的概要信息、提供查看程序集中IL的能力以及提供对第三方插件的支持。 程序集,作为.NET时代的动态链接库,蕴藏了太多的软件秘密。为此,Visual Studio内置的ILDASM成为最初挖掘程序集的上佳工具。但自从Reflector出现后,ILDASM相形见绌。因为,Reflector能提供更多的程序集信息,而且是免费的工具。   如今,在Visual studio中编译源代码(无论是VB还是C#)时,编译器都会将高级源代码翻译成MSIL,即“微软中间语言”,而不是特定的机器指令。具有更多安全性、版本控制、共享能力与其它相关元数据的中间语言(IL),是包在一个或多个DLL或可执行文件中的。   基于ILDASM检查程序集中的IL有时很有用,但它要求我们熟悉MSIL。通常,比起IL,大多数开发人员对像C#或Visual Basic这样的高级程序设计语言更为熟悉。   Reflector的出现使.NET程序员眼前豁然开朗,因为这个免费工具可以将.NET程序集中的中间语言反编译成C#或者Visual Basic代码。除了能将IL转换为C#或Visual Basic以外,Reflector还能够提供程序集中类及其成员的概要信息、提供查看程序集中IL的能力以及提供对第三方插件的支持。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值