Publish files to bin folder when source files are in a sub-folder with ClickOnce with WPF app -
i have found numerous articles on stackoverflow , elsewhere stating if wanted output files bin folder using clickonce, should set
buildaction
: content
copytoouputdirectory
: copy if newer
but of binaries located in dependencies
subfolder located in root of project , when publish content, being outputted
<wpf app folder>\dependencies
instead of being in <wpf app folder>
causing app not function properly.
any suggestions on how can change force clickonce
output specific files <wpf app folder>\
irrespective of source files
located.
i found work-around don't need move on. circumvent problem added required libraries root of project links , still set buildaction
content
, copytooutputdirectory
copy if newer
.
i thought i'd explain example may make bit more sense.
project path: c:\work\myapp , contains following sub-folders:
d:\work\myapp\myapp.csproj d:\work\myapp\myapp.xaml ... d:\work\myapp\bin\debug d:\work\myapp\bin\release d:\work\myapp\bin\release\myapp.exe d:\work\myapp\depedencies\liba.dll d:\work\myapp\depedencies\libb.dll etc...
the libraries third-party tools , contained in own folder:
d:\tools\mythirdpartylib\distributation\liba.dll d:\tools\mythirdpartylib\distributation\libb.dll
by having libraries in d:\work\myapp\dependencies did not work clickonce
install app in:
c:\users\\appdata\local\apps\2.0...\myapp.exe
and installed files located in dependencies sub-folder in:
c:\users\\appdata\local\apps\2.0...\dependencies\liba.dll c:\users\\appdata\local\apps\2.0...\dependencies\libb.dll
which caused app not work.
to around it, ended adding liba.dll , libb.dll root of project "linked files" , set buildaction
, copytooutputdirectory
not pointing linked files
d:\work\myapp\depedencies\liba.dll d:\work\myapp\depedencies\libb.dll
but instead pointing them:
d:\tools\mythirdpartylib\distributation\liba.dll d:\tools\mythirdpartylib\distributation\libb.dll
and seems have done trick. beef i've got 10 odd files listed in root of project in visual studio don't like:
myapp solution - myapp project - myapp.csproj - myapp.xaml - ... - liba.dll - libb.dll - ...
but have now.
hope helps others!
Comments
Post a Comment