Aljo_M
❔ MongoDb transactions in Asp.net core web api
Hello, i need some advice on what is the best thing to do. I am building asp.net core Web API with MongoDb identity. The logic goes like this controller > service > dbManagers.
I want to implement transactions so i can revert db operation if anything goes wrong. Now i dont want to repeat myself and add
using (var session = await _dbClient.StartSessionAsync())
in every method, instead i created a middleware:
But how can i access session object in my service. And what would be the better way to do something like this. Like what is best practice?93 replies
❔ How to create WPF installer?
Hello,
I want to create installer.exe file using WPF, so i have custom GUI. I want to copy files from url that i specify into clients program files folder. I want to be able to check if they have AutoCAD installed, and if it is currently running (i must close autocad in order to install).
I have tried Inno setup but it is too much of a hustle for me. Also i am using Rider IDE instead of visual studio and that is why i dont have the "Windows installer project template". What i want to do now is create a WPF exe regular desktop app and just run it as installer. Can i do that?
2. How to make it run in admin mode, so i can copy files to the folder that needs admin permissions?
3. Do i have to publish/ register installer somewhere so it gets officially certified?
4. How do i make my program be visible in controll panel/ uninstall program and be able to uninstall it from there?
5. Is there anything else i am forgetting and would be good to have?
Thanks anyone that can answer at least some of the questions :)
6 replies
✅ How to make installer for .net framework 4.7.2
Hello,
I am building a WPF plugin for AutoCAD. When i build solution i get 5 dlls, the main dll is called GUI and you can use "netload" command in autocad to load it and start using it.
What i want to do is create some kind of installer, exe or whatever that user can simply run and it would do the following:
1. Find if autocad is installed and copy 5 dlls into that folder
2. Edit a specific file that autocad installs "example.lisp" and add one line of code to that file
3. Optionally create uninstaller
What is best way? Should i use program like inno setup or create my own cs script? I am using Rider IDE and .net framework 4.7.2 (it is the latest supported version that autocad uses, i cant use other)
17 replies
❔ Serilog duplicate log with global exception handling
hey i am building an asp.net core web api and i implemented global exception handling like this:
however in the console i still get unhandled exception log message in adition to log message that this produces. what is the problem? i am using serilog, if you need some extra information i will gladly provide. thank you
2 replies