Reputation: 465
I have a azure function application that references another console project(MyConsoleApp) as "project Reference" when i publish the Azure function application, The console project is compiled and placed out side of the bin folder. How to make MyConsoleApp.exe file is copied to bin folder while publishing the Azure Function application?
Here is the VS project structure
Publish Output:
Upvotes: 0
Views: 1491
Reputation: 6218
You can extend it through MSBuild. Add this into your <azure function>.csproj
file:
<ItemGroup>
<FunctionsPublishAssemblies Include="$(TargetDir)MyConsoleApp.exe"></FunctionsPublishAssemblies>
</ItemGroup>
After that, click Publish button and you will find the MyConsoleApp.exe
is under publish\bin
folder during publish process.
Update
Add these under <azure function>.csproj
file:
<ItemGroup>
<FunctionsPublishAssemblies Include="$(TargetDir)MyConsoleApp.exe">
</FunctionsPublishAssemblies>
</ItemGroup>
<Target Name="DeleteFile" AfterTargets="_AspNetCoreProjectSystemPostPublish">
<Delete Files="$(PublishDir)MyConsoleApp.exe"></Delete>
</Target>
Then, re-publish your project.
Upvotes: 1
Reputation: 14080
Your idea is meaningless, this is by design. And, one thing that needs to be pointed out is that your exe has been compiled into the bin folder, and the bin folder you mentioned is the bin folder of the function app. You can manually put all the relevant files into bin and call them in the code, but IMHO this doesn't make much sense.
Please check your function app:
Upvotes: 0