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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -