asp.net mvc - Adding files to the bin directory at Build and Publish -


i have 2 license files include in \bin directory both when build and publish.

both files in app_data directory (their initial location doesn't matter, need end in \bin) , have following properties set:

  • build action = content
  • copy output directory = copy always

they in not \bin when build or publish.

what wrong setup: settings, folders, files, else...?

update

i moved files out of app_data directory , placed them in project root , copied \bin on build.

i've done in few projects expanding .csproject file slightly. following code should put directly beneath project node in webproject.csproj. afterbuild target copies set of files ("unreferenced dlls" in case) bin-folder when building visual studio. customcollectfiles same thing when deploying.

  <propertygroup>     <unreferenceddlls>..\lib\unreferenced\**\*.dll</unreferenceddlls>   </propertygroup>   <propertygroup>     <copyallfilestosinglefolderforpackagedependson>       customcollectfiles;       $(copyallfilestosinglefolderforpackagedependson);     </copyallfilestosinglefolderforpackagedependson>   </propertygroup>   <target name="afterbuild">     <message text="copying unreferenced dlls bin" importance="high" />     <createitem include="$(unreferenceddlls)">       <output taskparameter="include" itemname="_unreferenceddlls" />     </createitem>     <copy sourcefiles="@(_unreferenceddlls)" destinationfolder="bin\%(recursivedir)" skipunchangedfiles="true" />   </target>   <target name="customcollectfiles">     <message text="publishing unreferenced dlls" importance="high" />     <itemgroup>       <_customfiles include="$(unreferenceddlls)" />       <filesforpackagingfromproject include="%(_customfiles.identity)">         <destinationrelativepath>bin\%(recursivedir)%(filename)%(extension)</destinationrelativepath>       </filesforpackagingfromproject>     </itemgroup>   </target> 

the part need modify unreferenceddlls node match folder structure. **\*.dll part means "every dll file @ level beneath here".


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -