Forum Widgets
Latest Discussions
Debugging Java script in old asp core app
Hy, I need to modify an asp.net.core app witch I made years ago. in version 2.2. I do succeed to alter C# code in visual studio (2022), but I need to alter also some Java script. The problem is that if I try to do so and I want to debug it it seems that the script in my browser (MS Edge) is not changing. I have enabled Java script debugging in VS. I emptied the browsers cache but nothing seems to help. When I run the application in debugging mode and hit F12 I still see the old script. Please help!RobertWarningSep 07, 2025Copper Contributor25Views0likes0CommentsIs Native RDLC Report Support Planned for Future .NET Versions?
Good day Team, Given the demand for cross-platform reporting solutions, is there any plan to provide native RDLC (Report Definition Language Client-side) support for .NET Core or upcoming .NET releases (e.g., .NET 9 and beyond)? Many enterprise applications rely on RDLC, and the current lack of official support limits modernization efforts and forces continued reliance on the legacy .NET Framework or Windows-only workarounds. Is RDLC on the roadmap for future .NET versions, or should we consider alternative technologies for long-term reporting requirements? Any official guidance or updates would be greatly appreciated.VelkumarAug 19, 2025Copper Contributor60Views0likes0CommentsCreating a pooled resource for Dependency Injection
Currently, we have AddSingleton(), AddScoped(), and AddTransient() to generate resources in DI. Is there a way to request a new feature for an AddPooled() which will allow us to create and reuse unused instances from a pool? I have a class that has an expensive creation (a little over 5 seconds) that cannot be instantiated as a singleton. I don't need it to maintain any state, so it would be an ideal candidate for a pooled resource in DI.WhiteEagle5150Aug 08, 2025Copper Contributor49Views0likes0CommentsSingleton Class with Async
I'm working on building a Blazor Web App (.net 9) for an internal company portal. I want to load some persistent data to be used throughout the app into a class and then load that class as a scoped service. Most of the data will be fairly static, but expensive data to retrieve, ie: graph api call for members of groups, etc. So that data will also be loaded asynchronously. Everything I've found regarding loading data into a class asynchronously basically points back to a post by Stephen Cleary on Asynchronous Lazy Initialization: https://blog.stephencleary.com/2012/08/asynchronous-lazy-initialization.html My question is, given that this post was originally posted back in 2012, is this still an acceptable way of loading data asynchronously for a singleton or are there other, more modern approaches to this scenario?GarudaLeadMay 15, 2025Copper Contributor61Views0likes0Commentsaspnet c# iterate control in listview and remove a panel from placeholder in one column
trying to iterate through controls in listview to remove panel01 from placeholder if detected row in database condition dt.Rows[i]["BidEndWithError"].ToString() == "no" in the row: But all the listview's panel01 being removed even dt.Rows[i]["BidEndWithError"].ToString() == "no" is not 'no'`your text` `<asp:PlaceHolder ID="phLabel" runat="server"> <asp:Panel ID="panel01" runat="server"> Day Left : <%# Eval("BidDayLeft") %></br> Hour Left : <%# Eval("BidHourLeft") %></br> Minute Left : <%# Eval("BidMinuteLeft") %></br> Second Left : <%# Eval("BidSecondLeft") %></br> </asp:Panel> protected void lv01_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { string constr = ConfigurationManager.ConnectionStrings["bidsystemdb"].ConnectionString; using (SqlConnection con = new SqlConnection(constr)) { DataTable dt = new DataTable(); //string strSQL = "Select * from BidTable2 WHERE ProductName='Toy 1'"; string strSQL = "Select * from BidTable2"; SqlDataAdapter adpt = new SqlDataAdapter(strSQL, con); adpt.Fill(dt); for (int ij = 0; ij < e.Item.Controls.Count; ij++) { for (int i = 0; i < dt.Rows.Count; i++) { //Response.Write("lv01 reached!"); if (dt.Rows[i]["BidEndWithError"].ToString() == "no") { Response.Write("lv01 level 2 reached!"); PlaceHolder _phLabel = e.Item.Controls[ij].FindControl("phLabel") as PlaceHolder; Panel _pnlLabel = e.Item.Controls[ij].FindControl("panel01") as Panel; _phLabel.Controls.Remove(_pnlLabel); ContentPlaceHolder _MainContent = Master.FindControl("MainContent") as ContentPlaceHolder; UpdatePanel _udp01 = _MainContent.FindControl("udp01") as UpdatePanel; _udp01.Update(); } } } } } }`canalsoMay 13, 2025Copper Contributor47Views0likes0CommentsImplementation SMTP using MailKit in ASP .NET Core MVC
I am developing a web development project, where I have to implement email trigger along with message. Suppose there is a form where users will put thier name, email, title and message. After hitting submit button it will automatically send the message to the owner. How can I achieve this in latest version of this framework. And MailKit is Version 4.11.0.soumyadipmajumder03Apr 25, 2025Copper Contributor76Views0likes0CommentsEnable .Net ImageFormat.WebP in VS 2022 Prof ASPX Web.Config
Hi. I am developing C# ASPX Web sites in VS Professional 2022 (64 bit). I want to access the System.Drawing.Imaging.ImageFormat.WebP property so I can manipulate WebP files. I believe this requires .Net 4.8. I know there are 3rd party libraries out there - I would prefer to keep as much native MS code as possible. I am unable to get System.Drawing.Imaging.ImageFormat.WebP as a selection option for the ImageFormat. I can get all of the other formats e.g. TheImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg/Gif/Png etc. WebP is not shown as an option. I have Web.Config set as: <compilation optimizeCompilations="true" debug="true" targetFramework="4.8.1"> <assemblies> <add assembly="System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> <add assembly="System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> </assemblies> </compilation> <httpRuntime targetFramework="4.8.1" executionTimeout="240" maxRequestLength="20480" requestValidationMode="2.0" /> The Targeting Packs & SDK seem to be installed & enabled as per the screen snap below. Any help in resolving this is greatly appreciated. Many thanks, Peter.PeterS1Apr 15, 2025Copper Contributor154Views0likes0CommentsBlazor server app closes without error during debugging
The application started in debug mode stops reacting unexpectedly, without errors being intercepted and/or exceptions being generated. I don't know if this behavior can also happen when starting in release mode. In practice, the web application stops reacting in the browser. However, if I pause the execution in Visual Studio, a message warns me that the debug has timed out because the underlying application is no longer running. The attempts I made to solve the problem are: I tried to hook the unhandled errors with: AppDomain.CurrentDomain.UnhandledException += (handling code) But unhandled errors are not intercepted. I tried to remove the automatic start of the browser when the app starts in order to disconnect the closing of the browser with the end of the execution of the application. It does not solve the problem. Notes: It is a Blazor server application, it uses .NET 9 (but even with .NET 8 I encountered the problem). I updated visual studio, and all the nughet packages connected to the application. The application, terminating without there being any clues as to the cause because the debugging does not stop anywhere, can no longer be fixed. Thanks I tried to catch unhandled errors, but it seems that the app does not close due to exceptions during execution (debugging does not catch errors). I use Edge browser. I tried to remove breakpoints from the code.KocahoctpaMar 26, 2025Copper Contributor91Views0likes0Comments.NET Core render modes
I moved my Blazor webassembly application form .NET 8 to .NET 9. Previously it was basicly two projects: Client (static webassembly content served in docker by nginx on port 5007 with API address set to port 5007) Server (database app with API on port 5009) and the typical usage was that I connect in the browser to port 5007, webassembly content was downloaded to the browser and display data gathered form the API on port 5007. After migration to .NET 9 I can no loger download web assemby package (connection reset), but instead everything is served on port 5009 (old webassemby content and API). Moreover everything is working considerably faster but I`m confused: Why and how it is even working (how content from client appear in the server)? Which render mode I`m using currently? Do I still need my second container with nginx? How should I clean my Startup.cs in the Server project after taht migration? namespace eTabelki.Server { public class Startup { readonly string CorsOrigins = "CorsOrigins"; public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddDbContext<ApplicationDbContext>(options => options.UseSqlite(Configuration.GetConnectionString("DefaultConnection"))); services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies()); services.AddControllersWithViews(); services.AddRazorPages().AddJsonOptions(options => { options.JsonSerializerOptions.ReferenceHandler = System.Text.Json.Serialization.ReferenceHandler.Preserve; options.JsonSerializerOptions.PropertyNamingPolicy = null; }); services.AddCors(options => { options.AddPolicy(CorsOrigins, builder => builder.WithOrigins("http://10.0.10.3:5007", "https://10.0.10.3:5008") .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); }); services.AddTransient<IGenerateInvoiceService, GenerateInvoiceService>(); services.AddTransient<IExportService, ExportService>(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseWebAssemblyDebugging(); using (IServiceScope scope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope()) { var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>(); context.Database.Migrate(); ApplicationDbContextExtensions.EnsureSeedData(context).GetAwaiter().GetResult(); ApplicationDbContextExtensions.EnsureSeedTemplates(context).GetAwaiter().GetResult(); } } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); using (IServiceScope scope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope()) { var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>(); context.Database.Migrate(); ApplicationDbContextExtensions.EnsureSeedTemplates(context).GetAwaiter().GetResult(); } } var cultureInfo = new CultureInfo("pl-PL"); CultureInfo.DefaultThreadCurrentCulture = cultureInfo; CultureInfo.DefaultThreadCurrentUICulture = cultureInfo; app.UseHttpsRedirection(); app.UseBlazorFrameworkFiles(); app.UseStaticFiles(); app.UseRouting(); app.UseCors(CorsOrigins); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); endpoints.MapControllers(); endpoints.MapFallbackToFile("index.html"); }); } } }barooMar 19, 2025Copper Contributor86Views0likes0Comments
Resources
Tags
- ASP.NET Core156 Topics
- ASP.NET (Classic)82 Topics
- Web API66 Topics
- Blazor62 Topics
- mvc55 Topics
- Razor Pages35 Topics
- IIS.NET29 Topics
- security26 Topics
- SignalR6 Topics
- community1 Topic