Invoice
Urgen-Dorjee opened this issue · 5 comments
Excerpt from testing application invoice service
The Invoice service reacts to the DayHasPassed event that is normally published by the Time service. But in order to speed this up, we'll publish such an event using the RabbitMQ Management Dashboard. See the description of how to do this under Testing Notifications above.
Getting error while sending invoice
Error while handling DayHasPassed event.
System.IO.DirectoryNotFoundException: Could not find a part of the path '/Assets/banner.jpg'.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Net.Mail.AttachmentBase.SetContentFromFile(String fileName, String mediaType)
at System.Net.Mail.AttachmentBase..ctor(String fileName)
at System.Net.Mail.Attachment..ctor(String fileName)
at InvoiceService.InvoiceManager.SendInvoice(Customer customer, Invoice invoice) in /app/InvoiceManager.cs:line 255
at InvoiceService.InvoiceManager.HandleAsync(DayHasPassed dhp) in /app/InvoiceManager.cs:line 146
at InvoiceService.InvoiceManager.HandleMessageAsync(String messageType, String message) in /app/InvoiceManager.cs:line 65
I'm sorry, but I have not been able to reproduce this error.
I've also removed the InvoiceService docker image altogether and rebuilt it (using docker-compose build invoiceservice
). After that I've executed the test-scenario again (create and complete a maintenance-job and then send a DayHasPassed event using the RabbitMQ management console) and it created the invoice without any errors and containing the banner.
Can you also rebuild the InvoiceService docker image and try again?
I don't know what is the problem? I have tried removed and rebuild image not once but couple of times before i have posted this issue here. I have been getting this error. Anyway thanks for your reply/response, I will try to troubleshoot again, let's see. BTW thanks and appreciated your reply.
Thanks for your patience and I got it fix, I don't know why when I cloned your project it's somehow remove/missing the following csproj settings:-
<ItemGroup> <Content Include="Assets\banner.jpg"> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup>
that's how it's failed to navigate/find the banner.jpg file.
Thanks! you may :-)