简体   繁体   English

需要使用Visual Studio`reference`来启用Obfuscar属性

[英]Visual Studio `reference` needed to enable use of the Obfuscar attribute

My Obfuscar configuration does not seem to skip types the way I expected. 我的Obfuscar配置似乎没有像我期望的那样跳过类型。 I'm trying the alternative approach to obfuscate only what is marked. 我正在尝试替代方法来仅混淆标记的内容。

I enabled marking with the configuration element <Var name="MarkedOnly" value="true" /> 我使用配置元素<Var name="MarkedOnly" value="true" />启用了标记

In front of C# object definitions I am trying to mark for obfuscation using the [Obfuscate] attribute. 在C#对象定义之前,我尝试使用[Obfuscate]属性标记为混淆。 The instructions at http://obfuscar.codeplex.com/wikipage?title=Configuration&referringTitle=Documentation are to "reference Obfuscar.exe". http://obfuscar.codeplex.com/wikipage?title=Configuration&referringTitle=Documentation上的说明是“引用Obfuscar.exe”。 Neither the xxx_bin.zip nor the xxx_src.zip downloads contain such file. xxx_bin.zipxxx_src.zip下载均不包含此类文件。 I tried to reference Obfuscar.Console.exe and Obfuscar.dll in Visual Studio. 我试图在Visual Studio中引用Obfuscar.Console.exe和Obfuscar.dll。 In both cases the [Obfuscate] attribute is not recognized. 在两种情况下,都无法识别[Obfuscate]属性。

How can I setup to get this attribute to be recognized? 如何设置以使该属性被识别?

That attribute is obsolete and you should use System.Reflection.ObfuscationAttribute instead. 该属性已过时,您应该改用System.Reflection.ObfuscationAttribute Forgot to update the wiki page to reflect the changes. 忘记更新Wiki页面以反映更改。

If you add reference to Obfuscar.dll with copy local = true and add using Obfuscar; 如果使用复制local = true添加对Obfuscar.dll的引用,并using Obfuscar;添加using Obfuscar; to the class in question, you will be able to use attributes. 对于相关的类,您将可以使用属性。

Also, you don't add the .exe as a reference, instead copy to release folder. 另外,您不添加.exe作为参考,而是复制到release文件夹。 You can do this by adding as a link and Copy to Output directory or xcopy pre-build event etc. 您可以通过添加为链接并复制到输出目录或xcopy预构建事件等来实现此目的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM