Forum Widgets
Latest Discussions
It appears and error that does not exist
I am using VS 2022 Community and when i develope asp.net apps it happens sometimes that it appears an error that does not exist adn only after many hours of searching for the error or rewriting the same code the app begins to run correctly. Somehitng simmilar happened to any of you ? how can i avoid these strange behaviour of the compiler ? Thank you in advance Luis MartinlmobarqDec 13, 2025Copper Contributor24Views0likes0CommentsConnect .Net (4.6.2) to Dataverse using the Dataverse plugin
Hi Microsoft Tech Community, We have a Dataverse environment in our tenant, and I have its URL. I'm building a .NET application and need to connect it to Dataverse for data access. From the Learn docs, ChatGPT, and Copilot, it seems I need to use an App ID (Client ID) and Client Secret in the connection string (e.g., via Microsoft.PowerPlatform.Dataverse.Client). However, the Dataverse environment itself doesn't expose any App ID or Client Secret—where would I even find those if they exist? Here's the code snippet we found online that's using OAuth with AppId and RedirectUri, but we're unsure about the app registration part: using Microsoft.Crm.Sdk.Messages; using Microsoft.PowerPlatform.Dataverse.Client; using Microsoft.Xrm.Sdk; class Program { // TODO Enter your Dataverse environment's URL and logon info. static string url = "https://yourorg.crm.dynamics.com"; static string userName = "email address removed for privacy reasons"; static string password = "yourPassword"; // This service connection string uses the info provided above. // The AppId and RedirectUri are provided for sample code testing. static string connectionString = $@" AuthType = OAuth; Url = {url}; UserName = {userName}; Password = {password}; AppId = 51f81489-12ee-4a9e-aaae-a2591f45987d; RedirectUri = app://58145B91-0C36-4500-8554-080854F2AC97; LoginPrompt=Auto; RequireNewInstance = True"; static void Main() { //ServiceClient implements IOrganizationService interface IOrganizationService service = new ServiceClient(connectionString); var response = (WhoAmIResponse)service.Execute(new WhoAmIRequest()); Console.WriteLine($"User ID is {response.UserId}."); // Pause the console so it does not close. Console.WriteLine("Press the <Enter> key to exit."); Console.ReadLine(); } } Do I need to create a separate app registration in Microsoft Entra ID (Azure AD), link it to the Dataverse environment (perhaps as an application user?), and then use that app's Client ID/Secret in my .NET code? If so, could someone outline the exact steps, including permissions and Power Platform admin center setup? Any guidance or links to official walkthroughs would be greatly appreciated—thanks!AjayMDec 09, 2025Copper Contributor26Views0likes0CommentsDebugging 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 Contributor44Views0likes0CommentsIs 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 Contributor79Views0likes0CommentsCreating 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 Contributor70Views0likes0CommentsSingleton 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 Contributor91Views0likes0Commentsaspnet 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 Contributor59Views0likes0CommentsImplementation 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 Contributor110Views0likes0CommentsEnable .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 Contributor193Views0likes0CommentsBlazor 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 Contributor120Views0likes0Comments
Resources
Tags
- ASP.NET Core158 Topics
- ASP.NET (Classic)85 Topics
- Web API66 Topics
- Blazor62 Topics
- mvc56 Topics
- Razor Pages35 Topics
- IIS.NET29 Topics
- security26 Topics
- SignalR6 Topics
- community1 Topic