问题描述
我一直在尝试在使用Visual Studio 2010的2010 Word加载项应用程序的后期构建事件中使用标准Visual Studio宏。 我正在使用.net 4.0框架和Windows 7 64位系统。 宏没有做他们想要的
到。
具体来说,我正在使用构建后事件来使用Eazfuscator对我的程序集进行模糊处理。 标准的构建后事件字符串如下所示:
if / I" $(ConfigurationName)" =="释放" Eazfuscator.NET.exe" $(TargetPath)" --msbuild-project-path" $(ProjectPath)" --msbuild-project-configuration" $(ConfigurationName)" --msbuild-project-platform" $(PlatformName)"
-n --newline-flush
但是,当我构建项目时,宏不会像他们想象的那样填写。 以下是重建后输出的摘录:
if / I"" =="释放" Eazfuscator.NET.exe"" --msbuild-project-path"" --msbuild-project-configuration"" --msbuild-project-platform"" -n --newline-flush
在构建过程中,字符串只是空白 - 而不是填写配置名称,目标路径,项目路径和平台名称 - """。
因此,程序集不会被混淆。 但是,如果不使用内置宏的Visual Studio,而是填充实际信息,如下所示,后期构建事件可以正常工作:
if / I"Release" ; =="释放" Eazfuscator.NET.exe" C:\Users\Brad \Documents\Visual Studio 2010 \Projects \ testobfuscator \ testobfuscator \bin \Release\testobfuscator.dll" --msbuild-project-path" C:\Users\Brad \Documents\Visual
Studio 2010 \Projects \ testobfuscator \ testobfuscator \ testobfuscator.vbproj" --msbuild-project-configuration" Release" --msbuild-project-platform"任何CPU" -n --newline-flush
我使用VS 2010测试了许多不同的场景 - 使用.net 3.5 vs .net 4.0,vsto项目vs windows窗体项目,以及该错误仅发生在使用VSTO 2010的.net 4框架项目中。
我认为这可能是一个错误。
任何想法?
Brad
I've been trying to use the standard Visual Studio macros in a post-build event for a 2010 Word Add-in application using Visual Studio 2010. I'm using the .net 4.0 framework and a Windows 7 64 bit system. The macros don't do what they're suppose to.
Specifically, I'm using a post-build event to obfuscate my assembly using Eazfuscator. The standard post build event string is shown below:
if /I "$(ConfigurationName)" == "Release" Eazfuscator.NET.exe "$(TargetPath)" --msbuild-project-path "$(ProjectPath)" --msbuild-project-configuration "$(ConfigurationName)" --msbuild-project-platform "$(PlatformName)" -n --newline-flush
However, when I build the project, the macros don't fill in like they're suppose to. Below is an excerpt of the output after a rebuild:
if /I "" == "Release" Eazfuscator.NET.exe "" --msbuild-project-path "" --msbuild-project-configuration "" --msbuild-project-platform "" -n --newline-flush
Instead of filling in the configuration name, target path, project path, and platform name during the build process the strings are simply blank - "".
As a result the assembly doesn't get obfuscated. However, if instead of using the Visual Studio built in macros I populate with the actual information, like the following, the post-build event works fine:
if /I "Release" == "Release" Eazfuscator.NET.exe "C:\Users\Brad\Documents\Visual Studio 2010\Projects\testobfuscator\testobfuscator\bin\Release\testobfuscator.dll" --msbuild-project-path "C:\Users\Brad\Documents\Visual Studio 2010\Projects\testobfuscator\testobfuscator\testobfuscator.vbproj" --msbuild-project-configuration "Release" --msbuild-project-platform "Any CPU" -n --newline-flush
I've tested a number of different scenarios using VS 2010 - Using .net 3.5 vs .net 4.0, a vsto project vs a windows form project, and the error only occurs on .net 4 framework projects with VSTO 2010.
I think this may be a bug.
Any Thoughts?
Brad
这篇关于Post-Build宏不能与VSTO Tools 2010和.net 4.0一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!