Serilog Sinks BrowserHttp problem with ingest - serilog

I'm developing in ASP.NET Core Blazor WebAssembly.
Originally I had made a Blazor wasm project in Visual Studio 2019 where client, server, and shared were all part of the same project.
The project grew and I decided to split up the project into separate git repos.
I'm using Serilog.Sinks.BrowserHttp and it was working fine before I split up the project.
Now I'm getting an error in Console (Chrome):
Before the project was split up into two separate git repositories, all logging was saved in the database, but after the split, only the server-side logs are being stored in the database.
Is there a way I can store the logs straight into my Microsoft SQL database after having split up the Blazor project?
Here is my Program.cs logger configuration:
Logger Configuration
I just figured since both server and client were both in the same project and everything worked fine, the problem must be that the logger is assuming they still are in the same folder.

The problem was an old Nuget packet Serilog.Sinks.BrowserHttp 1.0.0-dev-00012. When selecting to manage nuget packets for my solution in Visual Studio, under package description the only version available is the installed version. But from the command line I was able to update to the lastest version 1.0.0-dev-00021.

Related

Docker GetServiceReferences: The given path's format is not supported

Trying to run locally a Web MVC application using Docker. Application compiles and runs fine when Set as StartUp Project outside of the docker-compose project but fails when docker-compose is Set as StartUp Project during the build when it comes to Target DockerGetServiceReferences: with
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(195,5): error : The given path's format is not supported.
I have added the docker-compose through Visual Studio 2017 to an existing application as described here:
How to containerize the .NET Framework web apps with Windows Containers and Docker
I appreciate this might be quite vague so if there are any more details I could provide please let me know.
EDIT:
Adding docker-compose to just default MVC template in a new project works fine so the problem seems to be with the legacy solution. Also noticed I can't navigate docker-compose project General Properties, I get the URI formats are not supported popup error
EDIT:
Adding a brand new MVC project from the template to the solution without any references to other projects also generates the error. Could this indicate that the problem might be somewhere on the solution level?
EDIT:
I have created a new Solution file and started to migrate all the projects. This way I am successfully able to compose docker image. Once I am finished migrating all of the project I will do a comparison on .sln files and try to see what is different.

Multiple VS 2017 Projects in one Docker Container

I am using VS 2017 15.6.4 which is the latest version. I have a single solution that has three web projects in it:
Solution:
Web Project 1
Web Project 2
Web Project 3
I would like to add Docker support so that all the web projects end up in a single container running IIS with the following IIS site structure:
Root Site (Web Project 1)
Admin Virtual Application (Web Project 2)
Campaign Virtual Application (Web Project 3)
Is there a way to accomplish this in Visual Studio 2017? When I add Docker support it seems to be on a project by project basis. I can run each project in its own container with no issues. Will I be forced to do this outside of Visual Studio?
I had a similar question and found the following helpful. Make sure you have Docker CE installed on your machine, along with VS2017 with Docker support. In VS2017, when you do "Add->Docker Support", it should automatically include the docker-compose.yml file at the root of your solution.
https://learn.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/multi-container-applications-docker-compose#step4_define_svcs_in_docker_compose_yml
There is also a sample application posted on github, linked below. Note that this follows .Net Core v2.1. I'm assuming you are using .net core and if so, note that v2.0 is end of life later this year so you should consider moving to v2.1
https://github.com/dotnet-architecture/eShopOnContainers
The github project above also has links to some free books talking more on docker and .net core. They helped me out a lot!

Runtime error when deploying to Azure because of one dll file

I build the app using Visual Studio and already publish it to Azure Services.
However, when trying to run it, I got the following error:
Could not load file or assembly 'RandomColorGenerator.Forms' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I looked into the bin folder in my local project and I can see the dll file just right.
Any suggestions?
According to your description, your MVC project could work on your development environment, but when deployed to Azure Web App, you got the above error. Per my understanding, you could follow the possible approaches below to troubleshoot this issue:
Use KUDU which is an analysis tool for Azure Web Apps, click on the "Debug console > CMD", then check your deployed web content under D:\home\site\wwwroot\. Make sure the missing dll has been deployed to Azure Web App successfully.
You could try to create a new web app for deploying your MVC project, in order to isolate this issue.
Additionally, you could try to empty your deployed web content via KUDU or redeploy your project by select "Delete all existing files prior to publish" under the "Setting > File Publish Options" of VS publish wizard.
UPDATE:
Based on your comment, you are using Azure Cloud Services. You could enable Remote Desktop and re-publish your application, then remote to your cloud services for troubleshooting this issue. Here is a similar issue, you could refer to it.
An attempt was made to load a program with an incorrect format.
As I known, the above message means that there be a 32-bit or 64-bit
platform conflict. For more details, you could refer to this similar issue.

Packaging .net MVC application as exe or msi

We have a .net MVC application where it involves deployments every week. We need to package the application and give it to the clients every week for them to install as an .exe or .msi
The package will involve DB changes also and site in IIS is already set.
The exe/msi just has to replace the old files(bin and views) and do the DB changes(run scripts). I don't want client to see either our code or DB script while installing.
So how can I achieve this as a single package?

Upgrade to nopcommerce 3.20 seems to break Plugin Configuration Views

We deployed an e-commerce site based on nopcommerce 3.10 and have developed a couple of plugins for the particular case. Everything was working properly.
Once version 3.20 was out, we downloaded the full source version, added our plugins and re-compiled the site making any required changes for the plugins as well.
It worked perfectly fine on the development environment (as is usualy the case ) but once we deployed it to the production server there were errors when trying to configure the plugins. Not just ours, almost all plugins.
The error was
Error executing child request for handler
'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.
System.Web.HttpException (0x80004005): Error executing child request
for handler
'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.
---> System.InvalidOperationException: The view 'Nop.Plugin.Shipping.CSTM.Views.ShippingCSTM.Configure' or its master
was not found or no view engine supports the searched locations.
This was not an issue of the views not being marked as embedded resource, because they were, and worked perfectly with version 3.10.
We even downloaded Visual Studio 2013 and re-compiled the project from a fresh code download while making sure that all the libraries (e.g. Razor, MVC) were in the correct version etc, but we had no luck.
Any ideas on what might the problem?
The Production server is on a shared hosting provider.
We have exactly the same issue as you, just to add information if you deploy debug not release you can't access the admin panel (404 - Page not found).
We where able to build nopCommerce 3.20 from source with VS 2013 and manually copy the content from Presentation\Nop.Web folder to our testing server and it works fine. But the Nop.Web folder contains csproj, cs and other unnecessary files.
(sorry i cannot add a comment because i don't have 50 reputation so i posted an answer)

Resources