asp.net mvc - MSBuild Publish and Compass Generated Sprites -


i'm using compass generate stylesheets , image sprites c# mvc .net project. great , works seamlessly. however, i'd able use msbuild "publish" functionality part of automated build. problem compass generated sprites change names time, , errors 1 when try build:

c:\program files (x86)\msbuild\microsoft\visualstudio\v12.0\web\microsoft.web.publishing.targets(2972,5): error : copying file images\icons-s88f86b4a16.png obj\release\package\packagetmp\images\icons-s88f86b4a16.png failed. not find file 'images\icons-s88f86b4a16.png'. 

i'm not sure how work around this. there way automatically add new images csproject , remove old ones? has run similar?

from personal experience, web deploy or publish visual studio pick files not part of solution long they part of web application on file system.

for example:

mvcsite
-- images/spirtes.png

if publishing copy of mvc site, contents of images folder replicated on web server if not included in project file.

---edited

the above solution work website , not web application. following work web application.

add end of publishing profile (production.pubxml)

  <target name="customcollectfiles">     <itemgroup>       <_customfiles include="test\**\*" />       <filesforpackagingfromproject include="%(_customfiles.identity)">         <destinationrelativepath>%(recursivedir)%(filename)%(extension)   </destinationrelativepath>       </filesforpackagingfromproject>     </itemgroup>   </target>   <propertygroup>     <copyallfilestosinglefolderforpackagedependson>       customcollectfiles;       $(copyallfilestosinglefolderforpackagedependson);     </copyallfilestosinglefolderforpackagedependson>      <copyallfilestosinglefolderformsdeploydependson>       customcollectfiles;       $(copyallfilestosinglefolderforpackagedependson);     </copyallfilestosinglefolderformsdeploydependson>   </propertygroup> </project> 

example build script

echo 'hello, world.' > "%workspace%\testmvc\test\fo1.txt"  "c:\windows\microsoft.net\framework\v4.0.30319\msbuild.exe" "%workspace%\testmvc.sln" /p:configuration=release /p:platform="any cpu" /p:publishprofile=production 

output msbuild

copying test\fo1.txt obj\release\package\packagetmp\fo1.txt. copying test\foo.txt obj\release\package\packagetmp\foo.txt. 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -