Shiv
Shiv
CC#
Created by Shiv on 11/12/2024 in #help
Hangfire recurring-jobs struck in queue
Hi team , I have scheduled a hangfire job to send mail at 9 30 pm everyday. It is hosted in IIS( .net core app). For some reason it will get struck in the queue. when ever I open the dashboard , it will get automatically execute. I have set IIS startmode alwaysrunning and Idle timeout 0. I want it be up and running all the time without getting struck in queue. Please help
7 replies
CC#
Created by Shiv on 5/7/2024 in #help
API Versioning
Hi team, I am developing Web APIs using .net8 for the mobile client. since the requirements keep on changing , I need to maintain versions for the api. How can this be implemented. should I add different controllers for different versions? PLease guide
3 replies
CC#
Created by Shiv on 3/4/2024 in #help
Need help to configure grafana dashboard
Hi team, I am following the steps given in https://github.com/dotnet/aspire-samples/blob/main/samples/Metrics/README.md to setup grafana dashboard. but in the startup.cs of the MetricsApp.AppHost project, the following line is giving error : builder.AddProject<Projects.MetricsApp>("app") .WithEnvironment("GRAFANA_URL", grafana.GetEndpoint("grafana-http")); the type or namespace MetricsApp doesnot exist. but it has the project reference in it. Any sugestions.
1 replies
CC#
Created by Shiv on 3/1/2024 in #help
How to think in terms of advanced programming?
Hi Team, I have 10+ years of experience in c#.net , When it comes to programming, I can write the code which will work .But when I see my own code, it is the same kind of code ( onion architecture where we create 'n' number of layers) which I kept writing from so many years. Now there are so many new approaches like vertical slice architecture. So many design patterns( like CQRS patterns) , I am not confident to use in existing projects. How can I update my skills? Sometimes I was not even aware of new updates in c# because I have been in comfort zone by using old code which had worked. Any guidance please? How to keep updating + implement the same ? Any resources/links/books/sites to visit ?
23 replies
CC#
Created by Shiv on 2/26/2024 in #help
Best way to trigger a Queued Email?
Hi Team, We are storing all the mails data in Queued Email table (Id,FromEmail,FromName,ToEmail ,ToName,Cc,Bcc,Subject,Body,CreatedOn,SendTries,IsSent,SentOn) before actually sending the emails. Now the question is how to trigger this at x min, y min or Immediately send. I can use schedulers for x min and y min but some mails need to sent immediately like OTP related mails. I cant wait for scheduler to pick it up. Any ideas on this ?
30 replies
CC#
Created by Shiv on 2/19/2024 in #help
Scheduling task in c# with failproof mechanism
Hi Team, I need to execute a function say at 9 pm everyday. I have used Task scheduler. That is working fine. But the thing is I don't have control over it when something fails. If Something fails ,I need to retry 'n' times . 1) Should retry mechanism be a part of main code itself or as seperate job which takes all the failed items and update the status. 2) Is there any better open source libraries available than Task Scheduler. Can anyone help please. Thanks
14 replies
CC#
Created by Shiv on 1/24/2024 in #help
C# library to generate .pkpass file(Apple wallet)?
Hi Team, Has any one worked on Generating pass files for Apple Wallet in c#. Is there any library to do so ...Please guide. ( This is due to the requirement that pass files need to be generated from server) Thanks Shiv
29 replies
CC#
Created by Shiv on 1/9/2024 in #help
Response Compression In ASP.NET Core
Team, I read about Response Compression In ASP.NET Core. It reduces the size of the response in api. Is it safe to use in production. Anybody have used ? Any drawbacks ?
12 replies
CC#
Created by Shiv on 12/16/2023 in #help
Python code inside c#
Team , we have some python code which need to be run inside c# . There is link to that in https://github.com/pythonnet/pythonnet#embedding-python-in-net but when i tried,it is giving error as Runtime.PythonDLL was not set . Does anyone know how to handle this ?
24 replies
CC#
Created by Shiv on 12/11/2023 in #help
Live line series Chart
Team, Need help on the following use case: I am using windows form application. I am plotting live line series chart .I have declared a global variable , assigning data to the global variable every 2 seconds ( have initiated timer) . passing the global variable to line series datasource. It is working. The above will work only for one single line series. I need to bind data to 'n' line series. how can i declare 'n' number of global variables. ( 'n' can be any number) I think the question is confusing. I can clarify any doubts . I can copy the code, how can i paste the code in discord Thanks Shiv
1 replies
CC#
Created by Shiv on 12/5/2023 in #help
razor pages vs .cshtml
Team , What is the difference between razor pages and cshtml.? razor pages looks like old asp.net web pages aspx and aspx.cs where views were tightly coupled to code behind(ASPX.CS). there was some drawbacks like tightly coupling in asp.net web forms and then comes mvc . what was the reason to bring razor pages and code behind again? any architectural reason?
10 replies
CC#
Created by Shiv on 11/22/2023 in #help
✅ @ in the property name c#
Team , Is there any way to get @ in the property name like this public class TestClass { [JsonProperty("@context)] public string @context { get; set; } } Adding Jsonproperty , I am able to deserialize . but I need @context as output property,right now it is coming as just context But Underscore is working public class TestClass { [JsonProperty("@context)] public string _context { get; set; } } Please guide on this
45 replies
CC#
Created by Shiv on 11/21/2023 in #help
Auto refresh inside windows form
No description
20 replies
CC#
Created by Shiv on 11/16/2023 in #help
Web scraping using c#
Hi Team, I need to Web scrap the websites and get the terms and conditions(Terms of Use) content. How can we acheive this. Is there any open source library to achieve this ..?
14 replies
CC#
Created by Shiv on 9/8/2023 in #help
❔ Read large data over TCP
Team need inputs on reading large data using TCPClient. I need to read data using TCPClient , I am sending a command and receiving data. but not sure whether I have read complete data. How do i check whether all the data has been read and how do I get the buffer size at receiver end ..can I use int.Max like Byte[Int32.Max]. But i noticed I am not getting the whole data at once.Should I loop it until I get the complete data? using (TcpClient client = new TcpClient("192.168.100.123", 10001)) { using (NetworkStream stream = client.GetStream()) { using (StreamReader reader = new StreamReader(stream)) {
byte[] outStream = System.Text.Encoding.ASCII.GetBytes(";"); stream.Write(outStream, 0, outStream.Length);
// Buffer to store the response bytes. Byte[] data = new Byte[5000]; // how do i know this size //string content = new StreamReader(stream, Encoding.Unicode).ReadToEnd();

Int32 bytes = stream.Read(data, 0, data.Length); var responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes); } } }
206 replies
CC#
Created by Shiv on 9/2/2023 in #help
✅ Catching exception at each function or globally?
Team , I am developing .net 6 web api project. Is it good to catch a exception at each function and log or globally handle it. Any suggestions?
53 replies
CC#
Created by Shiv on 8/24/2023 in #help
❔ How to manage Dapper connection with sqlite in windows form application?
Team can i use singleton for managing connection of dapper in windows form application. What is the best practice here? Or open and close the connection when ever I required?
2 replies
CC#
Created by Shiv on 8/17/2023 in #help
❔ Has anyone worked on PUBNUB c# sdk?
Need inputs on publishing and subscribing. Please help
99 replies
CC#
Created by Shiv on 8/8/2023 in #help
❔ Optimizing Homescreen API
Hi Team, I need few inputs on optimising Homescreen API(developed using .net6) consumed by mobile client. Right now when a user login, we are running few background calculations and calling 3rd party services which is taking upto 25 seconds for the Home screen API to return. can I split it into two parts 1) Return basic info from API ( which will take around 2 seconds) 2) Return all other responses using SignalR .( can we use SignalR for this kind of usecases) Will this approach work?
21 replies
CC#
Created by Shiv on 8/1/2023 in #help
✅ AppContext in web api project
Team, Do we have something like appcontext in .net core web api project where we store all the frequently used objects and all the users need to access the objects(application scope). (To reduce the call to db)
130 replies