Docker–third part–part 19
Trying different codes in the csproj to add dynamically content from a folder ( including the dll’s copied there ) and to retrieve in the output directory: ( reading from internet of all those stuff)
Version 1:
<!–<Target Name=”ContentsBeforeBuild” AfterTargets=”BeforeBuild”>
<ItemGroup>
<Content Include=”plugins\**” />
</ItemGroup>
</Target>—>
Version 2:
<!–<Content Update=”plugins\**\*.dll” CopyToOutputDirectory=”Always” LinkBase=”plugins”>
</Content>—>
Version 3:
<!–<Content Update=”$([System.IO.Directory]::GetFiles(‘$(ProjectDir)plugins’, ‘*.*’, SearchOption.AllDirectories))” CopyToOutputDirectory=”PreserveNewest”>–>
<!–</Content>—>
Version 4: – works!
<ItemGroup>
<None Remove=”plugins\” />
<Content Include=”plugins\**\*.dll” CopyToOutputDirectory=”Always”/>
</ItemGroup>
Now, I want to make this docker each time that I modify and show to the end users to test it.
However, this should be not in the same process as running the tests – the tests should be very fast in order to see problems – the making of release software could take minutes.
Going to https://dev.azure.com/ignatandrei0674/ and making a new project to deal with this.Creating new project, integrating with GitHub – seamless integration with .NET Core – even created a azure-pipelines.yml for me.
Extra bonus: GitHub actions runs on Ubuntu. I will put Azure to run on Windows. This way, I know that the build of the project works either way
Now, a different error in docker:
Access to the path ‘C:\app\InfoValutar\InfoValutarDOS\obj\InfoValutarDOS.csproj.nuget.dgspec.json’ is denied.
Oh, forgot to put a .dockerignore . First I put where the docker file was –big mistake. Should be put where the folder to be included is!
Now ,a different error in docker
Access to the path ‘C:\app\InfoValutar\InfoValutarWebAPI\InfoValutarWebAPI.xml’ is denied.
Oh, give me a break! Delete the .xml and add later to .gitignore and .dockerignore ( as full path, I do not want to ignore ALL xml files)
I works now!!!!
Infovalutar
And one hour passes...(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )