当前位置: 首页 > news >正文

杭州招标信息网/电脑网络优化软件

杭州招标信息网,电脑网络优化软件,网页工具栏怎么显示出来,html5手机wap网站模板这种事情就是一个字烦人,蛋疼,特别蛋疼。 搞了我一天。方法有几种,都特别烦,一个是 build event , 一个是 msbuild今天说 build event 1.在 Build Events 中 , Pre-build 输入:copy $(ProjectDir)Time/no…

这种事情就是一个字烦人,蛋疼,特别蛋疼。 搞了我一天。

方法有几种,都特别烦,一个是 build event , 一个是 msbuild

今天说 build event

1.在 Build Events 中 , Pre-build 

输入:

copy  $(ProjectDir)Time/norlib.Time.Holidays.xml  "$(TargetDir)norlib.Time.Holidays.xml"set VCInclude=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include
set SDKInclude=C:\Program Files (x86)\Windows Kits\8.0\Include\um
set SDKShared=C:\Program Files (x86)\Windows Kits\8.0\Include\shared
echo $(IntermediateOutputPath)set RCDIR=
IF EXIST "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\rc.exe" (set RCDIR="C:\Program Files (x86)\Windows Kits\8.0\bin\x86\rc.exe")echo  (%RCDIR%  /i "%VCInclude%"  /i "%SDKInclude%" /r /fo "$(IntermediateOutputPath)\res1.res" "$(ProjectDir)Controls\OpenFileOrFolderDialog\res1.rc")if not defined RCDIR ( echo "Error! Unable to find rc.exe.")  else  (%RCDIR%  /i "%VCInclude%"  /i "%SDKInclude%" /i "%SDKShared%" /r /fo "$(ProjectDir)res1.res" "$(ProjectDir)Controls\OpenFileOrFolderDialog\res1.rc")if not defined RCDIR (Exit 1)

主要是从第二行开始看

首先要注意 c# 下面很多宏是失效的, 比如 $(VCInstallDir) , 还有写宏和 vc 是指向不一样的目录,比如他妈的: $(FrameworkSdkDir)

这个宏 $(FrameworkSdkDir)  在vc下 指向: C:\program files(x86)\windows kits\8.0\  在里面bin\x86 我们可以找到rc.exe

但是在 c# 下指向:C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\

瞬间晕死, google了半天发现个帖子:

http://go4answers.webhost4life.com/Example/get-winsdk-configuration-tool-work-41266.aspx

他这么说的:

After some investigation and reflecting using Redgate Reflector, I found that the variable $(FrameworkSDKDir) will always resolve to the 6.0a installation if that SDK is installed and the target framework is 3.5. This is due to a possible bug in the .NET Type Microsoft.Build.Shared.FrameworkLocationHelper, in assembly Microsoft.Build.Utilities.v3.5, Version=3.5.0.0 that shipped with .NET Framework 3.5. The problem I see is in the property PathToDotNetFrameworkSdkV35 in this class. It first reads the registry value for SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A\InstallationFolder, while I believe it should actually first read SOFTWARE\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder. I worked around this problem by hacking the key SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A\InstallationFolder to point to 6.1. This enables me to use rc.exe from SDK 6.1, while it might affect other products that expects to retrieve the 6.0a installation folder from the registry.I have the following questions regarding the issues described above:Why would rc.exe install  to different locations on two otherwise seemingly equivalent machines? 
Is the code that I refered to in Microsoft.Build.Shared.FrameworkLocationHelper affected by a bug? and if so
Is there a work around / fix other that the method that I described?

反正要解决也挺麻烦的,后来如你所见我就在 build events 里面创建了一个 %Macro%

比如:


set VCInclude=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include

这里要注意了,你不能写 VCInclude =....... 这样Macro变成了 %VCInclude % .........还有就是不需要双引号。


这样编译成功后, 就有了一个 res 文件,我们千辛万苦就是为了得到这个res文件

然后 c# Project Property -> Application -> Resources -> Resource file (radio button):  输入res文件的绝对路径

这样就能加入了win32资源文件了


里面挺好玩的。


参考:

http://stackoverflow.com/questions/8057080/how-to-embed-a-resource-in-a-net-pe-executable

http://blogs.msdn.com/b/astebner/archive/2006/02/28/541036.aspx

以后还是要上MSBUILD

http://www.jmfq.cn/news/4854457.html

相关文章:

  • 网站搭建团队/淘宝指数在线查询
  • 网站托管服务适合/微信推广怎么弄
  • 图解asp.net网站开发实战/今天新闻头条新闻
  • 在线看网站建设/湖南平台网站建设制作
  • 怎样做购物网站/游戏加盟
  • 小程序做网站/天津优化公司
  • 品牌型网站建设哪里好/网站百度不收录的原因
  • 团购做的好的网站/线上营销平台
  • 手机网站跟pc网站有什么不同/百度怎么注册自己的网站
  • 记事本网站开发/建站模板网站
  • 织梦做音乐网站/合肥网站快速排名提升
  • 怎么看网站做没做备案/网络营销的主要内容有哪些
  • 建设一个网站的需求分析/外链工具
  • 网站开发项目可行性分析/曲靖seo
  • 重庆微信网站开发公司/免费的自助建站
  • 网站建设软件排行/汉中网站seo
  • 闵行网站搭建哪里有/深圳网站建设推广
  • 免费诶网站建设/百度推广seo是什么意思
  • 二级网站模板/打广告
  • 网站建设在哪里发布/株洲网站设计外包首选
  • 专业做网文的网站有哪些/网络推广文案有哪些
  • 冷库建设网站/什么平台可以发广告引流
  • 国内知名网站建设/新闻最近新闻10条
  • 如何设计网站制作方案/企点
  • 网站建设企业文化/软文写作什么意思
  • 网络设计概念/百度首页优化排名
  • wordpress 网站收录/线上拓客渠道有哪些
  • 买做指甲的材料在哪个网站/如何自己做一个软件
  • 泉州晋江网站建设/免费引流推广怎么做
  • 微信制作网站/引流人脉推广软件