1

I have an Azure website built using Visual Studio and .NET (C#). I noticed that for whatever reason, an assembly was not getting put into the /Bin folder when BS built the app. So I copied the file to my Bin folder. However, when I deploy, the file I manually copied to the /Bin folder isn't getting included in the deployment. Or at least I don't think it is.

Is there a way I can tell VS to include this file when I publish? Or is there a way I can tell VS to republish the entire app, instead of just files it detects are changed?

Randy Minder
  • 47,200
  • 49
  • 204
  • 358
  • Copy that DLL to one folder and add reference of from it – Bhaumik Shah May 03 '15 at 16:24
  • Have you tried setting "Copy local" to "true" in that reference? – gbellmann May 04 '15 at 19:03
  • This has been happening sporadically for me - and only when publishing to a deployment slot. If I mess around with the 'Precompile before publishing' settings enough, it will EVENTUALLY publish the DLL successfully. But it's an unpredictable PITA in the meantime. (CopyLocal is always true.) – oflahero Sep 13 '16 at 16:02

1 Answers1

0

For managed assemblies, setting CopyLocal to true for the reference fixes it.

If it's an unmanaged binary, then you can follow following approach:

  • Look for AfterBuild on the .csproj file, and include a command to copy the binary to bin directory.

    <Message Text="Copy $(SolutionDir)Lib\binary.dll to $(OutDir)binary.dll" Importance="high"/>
    <Copy SourceFiles="$(SolutionDir)Lib\binary.dll" DestinationFiles="$(OutDir)binary.dll" />
    
  • Include the binary on the .csproj along with other files. Setting visible to false will hide the file on Solution Explorer.

    <Content Include="Bin\binary.dll">
      <Visible>false</Visible>
    </Content>
    
Scott Weldon
  • 9,673
  • 6
  • 48
  • 67
Amit
  • 25,106
  • 25
  • 75
  • 116