.net - How can I embed an configuration-specific manifest file in my c# app? -


i'd embed platform-specific manifest file in c# app. there easy way in visual studio 2008 without using external script called after build finished?

in creating c# app, configuration , platform dropdowns disabled application tab, preventing me selecting architecture or configuration specific manifest embed app. i'm forced use 1 manifest whole application.

i thought of using post build event call little script embed right manifest based on $(configuration) macro variable, , works, want without calling other script , want know if it's possible without using build events.

can embed x86 , x64 assembly references in same manifest file , run time load correct one?

you need add app.manifest file. right-click project, select "add" -> "new item...". select "general" entry on left tree view under "visual c# items". "templates" list, locate , select item call "application manifest file". click add.

now have manifest, let's make platform specific. right-click project , select "unload project". right-click again , select "edit {project name}.csproj".

locate first configuration section, @ end should find...

<propertygroup>     ...     <applicationmanifest>app.manifest</applicationmanifest> </propertygroup> 

you need move applicationmanifest element appropriate configuration section platform configuration. may need add section xml did here anycpu:

<propertygroup condition=" '$(platform)' == 'anycpu' ">     <applicationmanifest>app.manifest</applicationmanifest> </propertygroup> 

when finished, save file, right-click project, , select "reload project".


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -