Recent Discussions
AacAmbientLighting.exe Issue
Hi, I'm not sure if this is an appropriate place to post this, please do let me know if not. I have for the last two days been getting the following message popping up on my machine and I can't work out for what reason. I updated my Internet Security during that time, so automatic thought was it was that preventing the files been read, but I've disabled the Internet Security and the error message still crops up I have also uninstalled and reinstalled Armoury Crate, uninstalling it does take the error away, but that causes other issues and I use ROG hardware. So I kind of need Armoury Crate to be functioning. This is the error that I'm seeing: When I try and install the .Net Runtime software it says that 'the specified account already exists' so I'm a littled confused as to what might be causing the issue and how I can resolve it and keep Armoury Crate on my machine.2Views0likes0CommentsEnable .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.1View0likes0CommentsBuild Scalable Web Apps and APIs with ASP.NET Core, Blazor, Angular for Modern Web Apps
I’m starting this discussion because many developers today need guidance on how to build modern, scalable web applications and APIs by combining ASP.NET Core, Blazor, and Angular—three powerful technologies within the .NET ecosystem. Whether you're focused on server-side development, creating dynamic client-side apps, or integrating both, these frameworks provide incredible capabilities to enhance your projects ASP.NET Core for API Development: ASP.NET Core is a robust, high-performance framework that allows you to create powerful APIs. Some of the best practices we’ll cover include: - Designing RESTful APIs with ASP.NET Core - Utilizing Entity Framework Core for efficient database access - Securing APIs with JWT and OAuth - Handling asynchronous requests for optimal performance - Implementing API versioning and changes over time Building Dynamic Web Apps with Blazor: Blazor enables you to create interactive web applications using C# instead of JavaScript. We will discuss: - Blazor Web Assembly vs. Blazor Server: Differences and use cases - Creating reusable Blazor components for UI - Integrating third-party JavaScript libraries with Blazor - Using SignalR for real-time features - Optimizing Blazor for performance Angular for Full-Featured Client-Side Development: Angular is a powerful, full-featured front-end framework that excels in creating dynamic and complex user interfaces. In this section, we'll dive into: - Why you might choose Angular over Blazor in certain cases - Using Angular CLI to scaffold, build, and maintain apps - Managing state in Angular with NgRx or RxJS - Connecting Angular with ASP.NET Core APIs for data handling - Working with Angular components, services, and routing for a seamless user experience Combining Angular and Blazor in a Single Application: You may have use cases where you want to combine both Blazor and Angular in one application to leverage the strengths of each framework: - When to use Angular for complex frontend features (e.g., dynamic forms, complex data visualization) and Blazor for simpler components or backend-heavy apps. - Managing communication between Angular and Blazor components in a single page (e.g., using - JavaScript Interop to pass data between the two). - Handling authentication and state management across both frameworks. Integration between Frontend (Blazor/Angular) and Backend (ASP.NET Core): No matter whether you're using Angular or Blazor for the frontend, integrating these with your backend API is key. We'll discuss: - Setting up HttpClient for making API calls from both Blazor and Angular - Working with SignalR to enable real-time features in both frontends - Managing authentication and authorization across both Angular and Blazor (JWT, OAuth) - Best practices for passing data and sharing state between the frontend and backend Scalable and Maintainable Web Apps: When building full-stack web applications, it's important to focus on scalability and maintainability. Here are some practices for achieving this: - Structuring your application code to separate concerns (e.g., services, components, repositories) - Utilizing Dependency Injection for flexible and testable code - Modularizing your codebase for easier updates and maintenance - Using Lazy Loading for Angular and Blazor components to improve performance - Leveraging Caching strategies to enhance response times Testing and Continuous Deployment: For any modern application, testing and deployment are crucial. We’ll discuss: - Unit and integration testing in ASP.NET Core, Blazor, and Angular - Automated end-to-end testing (e.g., with Cypress for Angular, bUnit for Blazor) - Continuous Integration/Continuous Deployment (CI/CD) strategies for seamless deployment to cloud platforms like Azure or AWS When to Choose Angular, Blazor, or Both: It’s essential and interesting to know when to use each of these frameworks depending on your project’s needs. Some scenarios we’ll explore: - When to go for Blazor for a unified C# experience in both frontend and backend - Why you might opt for Angular when building highly interactive, feature-rich web applications - Hybrid approaches where you can use Blazor and Angular together for a robust full-stack solution SO: Combining ASP.NET Core, Blazor, and Angular allows developers to choose the right tool for the right job, creating flexible, scalable, and maintainable web applications. Whether you’re leveraging Blazor for its deep integration with .NET or Angular for its powerful frontend capabilities, these technologies offer a powerful suite of tools to build modern web applications. What are your thoughts? How have you integrated Angular or Blazor with ASP.NET Core in your projects? Share your experiences and challenges, and let's collaborate on solutions!219Views7likes2CommentsMYSYS2 Installation Guide for Cross-Compilation on Visual Studio 2017, 2019, 2022, and WSL2
Use Notepad to create this file on your desktop or another folder: MYSYS2.txt MYSYS2 Paths: Use Notepad to create this file on your desktop or another folder: MYSYS2_Path_Win.txt NOTE: This folder layout, which can be easily edited, was generated with a batch file that utilizes the default configuration that comes with the UI-based setup program / installer. Use Notepad to create this file on your desktop or another folder: Generate_MYSYS2_Folder_Paths_Win.bat16Views0likes0CommentsConvert the standard Blazor navigation menu to a collapsible icon menu
While I admittedly love Blazor I’ve always changed the out-of-the-box navigation menu that comes with it. It’s the first manoeuvre I pull when spinning up a new Blazor app, stripping out the purple gradient and getting it in, what I consider, a “blank slate state”. The other change I’ve wanted to make to the out-the-box look is one of those deluxe collapsible menus that leave just the icons showing. Anyone that’s used Azure DevOps will know what I’m talking about. I’ve included a picture to show DevOps example of what I’d like to see in my Blazor app. It gives a load of extra screen real estate which is always a priority for me in business applications particularly with complex or intensive workflows. Plus it gives the user the option to remove the text prompts once they are familiar with the system which is supported with carefully selected icon choices. As with most tasks that I assume will be an obvious solution I hit my search engine of choice and looked to avoid reinventing the wheel. However I found no source of pre-written changes to achieve this and was directed to fairly expensive third party controls to solve this one for me, which, being tight fisted, pushed me to do it for myself. Here I hope you save you the trouble of paying a pretty penny or having to wrestle the CSS into submission and provide a guide for producing a nice collapsible icon navigation menu by altering the existing out of the box menu in Blazor. In the following example I have left all the standard styling as is with the menu and just done the changes required to make the collapsible menu. The three files that require changes are MainLayout.razor, NavMenu.razor and NavMenu.razor.css. The code changes are shown below: Firstly the NavMenu.razor requires a bool value (IconMenuActive) to indicate whether the icon menu is showing or not, then wrap the text of the each NavItem in an if statement dependent on this bool. Then a method for toggling this bool and EventCalBack to send a bool to the MainLayout.razor for shrinking the width of the sidebar. Lastly there needs to be the control for switching menu views (I used the standard io icon arrows). NavMenu.razor <div class="top-row ps-3 navbar navbar-dark"> <div class="container-fluid"> <span class="oi oi-monitor" style="color:white;" aria-hidden="true"></span> @if (!@IconMenuActive) { <a class="navbar-brand" href="">The Menu Title Here</a> } <button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu"> <span class="navbar-toggler-icon"></span> </button> </div> </div> <div class="@NavMenuCssClass" @onclick="ToggleNavMenu"> <nav class="flex-column"> <div class="nav-item px-3"> <NavLink class="nav-link" href="" Match="NavLinkMatch.All"> <span class="oi oi-home" aria-hidden="true"></span> @if (!@IconMenuActive) { <label>Home</label> } </NavLink> </div> <div class="nav-item px-3"> <NavLink class="nav-link" href="counter"> <span class="oi oi-plus" aria-hidden="true"></span> @if (!@IconMenuActive) { <label>Counter</label> } </NavLink> </div> <div class="nav-item px-3"> <NavLink class="nav-link" href="fetchdata"> <span class="oi oi-list-rich" aria-hidden="true"></span> @if (!@IconMenuActive) { <label>Fetch data</label> } </NavLink> </div> </nav> </div> <div class="bottom-row"> <div class="icon-menu-arrow"> @if (!@IconMenuActive) { <span class="oi oi-arrow-left" style="color: white;" @onclick="ToggleIconMenu"></span> } else { <span class="oi oi-arrow-right" style="color: white;" @onclick="ToggleIconMenu"></span> } </div> </div> @code { //bool to send to MainLayout for shrinking sidebar and showing/hide menu text private bool IconMenuActive { get; set; } = false; //EventCallback for sending bool to MainLayout [Parameter] public EventCallback<bool> ShowIconMenu { get; set; } private bool collapseNavMenu = true; private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null; private void ToggleNavMenu() { collapseNavMenu = !collapseNavMenu; } //Method to toggle IconMenuActive bool and send bool via EventCallback private async Task ToggleIconMenu() { IconMenuActive = !IconMenuActive; await ShowIconMenu.InvokeAsync(IconMenuActive); } } Next I add in a bit of CSS in to NavMenu.razor.css to put the arrow for toggling the menu at the bottom of the sidebar and a media query to make sure it doesn't show up in mobile view. The CSS classes added are .bottom-row and .icon-menu-arrow. NavMenu.razor.css .navbar-toggler { background-color: rgba(255, 255, 255, 0.1); } .top-row { height: 3.5rem; background-color: rgba(0,0,0,0.4); } .bottom-row { position: absolute; bottom: 0; padding-bottom: 10px; text-align: right; width: 100%; padding-right: 28px; } .icon-menu-arrow { text-align: right; } .navbar-brand { font-size: 1.1rem; } .oi { width: 2rem; font-size: 1.1rem; vertical-align: text-top; top: -2px; } .nav-item { font-size: 0.9rem; padding-bottom: 0.5rem; } .nav-item:first-of-type { padding-top: 1rem; } .nav-item:last-of-type { padding-bottom: 1rem; } .nav-item ::deep a { color: #d7d7d7; border-radius: 4px; height: 3rem; display: flex; align-items: center; line-height: 3rem; } .nav-item ::deep a.active { background-color: rgba(255,255,255,0.25); color: white; } .nav-item ::deep a:hover { background-color: rgba(255,255,255,0.1); color: white; } @media (min-width: 641px) { .navbar-toggler { display: none; } .collapse { /* Never collapse the sidebar for wide screens */ display: block; } } @media (max-width: 640px) { .bottom-row { display: block; } } Finally I add in the handler for the EventCallback to MainLayout.razor and a method to alter the width of the sidebar. MainLayout.razor @inherits LayoutComponentBase <div class="page"> <div class="sidebar" style="@IconMenuCssClass"> <NavMenu ShowIconMenu="ToggleIconMenu"/> </div> <main> <div class="top-row px-4"> <a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a> </div> <article class="content px-4"> @Body </article> </main> </div> @code{ private bool _iconMenuActive { get; set; } private string? IconMenuCssClass => _iconMenuActive ? "width: 80px;" : null; protected void ToggleIconMenu(bool iconMenuActive) { _iconMenuActive = iconMenuActive; } } The final product of these little changes are shown in the pictures below: I'd love to hear if anyone has tackled this in a different way to me and if they've got any ideas on making it cleaner. Have yourselves a wonderful day, Gav71KViews10likes16CommentsC# code causing XSS vulnerability
Hello, We get a vulnerability scan that is show that one of my pages is susceptible to a XSS attack. We are using a telerik tree view to display different data when the nodes are expanded. This is the information they reported back to me. Issue Detail The value of the scrollPosition JSON parameter within the ctl00_ContentPlaceHolder1_VIndex2_tvIndex_ClientState parameter is copied into the HTML document as plain text between tags. The payload sbi7s<script>alert(1)</script>tx52l was submitted in the scrollPosition JSON parameter within the ctl00_ContentPlaceHolder1_VIndex2_tvIndex_ClientState parameter. This input was echoed unmodified in the application's response. Request older1_VIndex2_tvIndex_ClientState=%7b%22expandedNodes%22%3a[]%2c%22collapsedNodes%22%3a[]%2c%22logEntries%22%3a[]%2c%22selectedNodes%22%3a[]%2c%22checkedNodes%22%3a[]%2c%22scrollPosition%22%3a%220**sbi7s%3cscript%3ealert(1)%3c%5c%2fscript%3etx52l**%22%7d&ctl00_RadWindowManager1_ClientState=&__ASYNCPOST=true&ctl00%24ContentPlaceHolder1%24VIndex2%24btnAddCart=Add%20To%20Cart Response > HTTP/2 200 OK > Cache-Control: no-cache > Pragma: no-cache > Content-Type: text/plain; charset=utf-8 > Expires: -1 > Server: Microsoft-IIS/10.0 > X-Powered-By: ASP.NET > X-Frame-Options: SAMEORIGIN > X-Ua-Compatible: IE=edge,IE=11,IE=10,IE=9,IE=8,IE=7 > Strict-Transport-Security: max-age=31536000 > Date: Wed, 19 Mar 2025 16:26:27 GMT > Content-Length: 82 > 68|error|500|0**sbi7s<script>alert(1)</script>tx52l** is not a valid value for Int32.| What is the best way to pinpoint this issue? How do I fix this so it isn't showing up on the scans?Solved59Views0likes3Comments.Net 8 Isolated upgrade issue- RPC Exceptions in .Net Core Function App
Hi Team, Need Immediate help. I am continuously receiving RPC Exceptions when I have upgraded my Function App to .Net 8 previously I had zero exceptions related to this in .Net 6. Scenario: We are creating builder with ConfigureFunctionsWebApplication() like below: 1. var builder = FunctionsApplication.CreateBuilder(args); 2. builder.ConfigureFunctionsWebApplication(); And basically, we have Http triggers and SB triggers in the application and only couple of them are facing issue and the error in AI states that this is an issue related to worker. I have copied multiple exception wrapped as an RPC exception below: 1. An exception was thrown by the invocation. Exception: System.TimeoutException: Timed out waiting for the function start call. 2. The operation has timed out at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.DefaultHttpCoordinator.SetFunctionContextAsync(String invocationId, FunctionContext context) 3.Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.DefaultHttpCoordinator.SetFunctionContextAsync(String invocationId, FunctionContext context) 4. Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.FunctionsHttpProxyingMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\extensions\Worker.Extensions.Http.AspNetCore\src\FunctionsMiddleware\FunctionsHttpProxyingMiddleware.cs:line 45 at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 96 Stack: at Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.DefaultHttpCoordinator.SetFunctionContextAsync(String invocationId, FunctionContext context) in D:\a\_work\1\s\extensions\Worker.Extensions.Http.AspNetCore\src\Coordinator\DefaultHttpCoordinator.cs:line 66 5. Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore.FunctionsHttpProxyingMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a\_work\1\s\extensions\Worker.Extensions.Http.AspNetCore\src\FunctionsMiddleware\FunctionsHttpProxyingMiddleware.cs:line 45 at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 9616Views0likes0CommentsEmbedded Json being interpretted incorrectly
I created an API project in .NET 6.0 with an endpoint that accepts a Json request body with Json embedded in one of the attributes of the request. The problem I'm having is that within the embedded Json, one of the values has an escaped double quotes right before an open square bracket, and when the embedded Json is received by the endpoint, the escaped double quote is missing. Here is an example of how the end point is being called:POST /DataRequest/MyDataBody:{ "HostName": "my-host-01", "Job": "some_job", "JobData": "{\"attr1\":\"value1\",\"attr2\":\"value2\",\"attr3\";\"[val3] foo\"}" } The issue I see with JobData is that the \"[ after the attr3 definition gets immediately translated to just [. When I say Immediately, I mean that I have a break point on the very first line of the endpoint code and the escaped double quote is already removed from the JobData attribute.So, when I'm looking at the value that was received by the end point, it looks like this:"JobData": "{\"attr1\":\"value1\",\"attr2\":\"value2\",\"attr3\";[val3] foo\"}" This ends up being invalid Json and causes errors further down in the code. I tried to do some research on this, but it's pretty hard to google something like this and get any sort of answer. I did some experimenting and found that these combinations:\"attr3\":\"\"[val3] foo\" produces "attr3":"[val3] foo"\"attr3\":\" [val3] foo\" produces "attr3":" [val3] foo" (note, there's a space between the escaped double quote and the bracket)It seems like something in the framework is incorrectly assuming that the open bracket is starting a list even though it's got an escaped double quote in front of it. I also found that the sequence ]\" does the same thing on the other end where the escaped double quotes gets dropped in the string. Is \"[ and ]\" a special case escape that I'm just not aware of? Has anyone else run across this? We've kind of worked around the issue using the space between the escaped double quote and the open bracket, but I was hoping to find out why this happens. If I'm posting this in the wrong place, please let me know where I should post this.24Views0likes2CommentsBlazor 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.16Views0likes0Comments.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"); }); } } }17Views0likes0CommentsDuck Game Crashes
I am hoping that someone here might be able to steer me in the right direction. I have posted in the game's forum, but I am not receiving any support there. I have a new laptop running Windows 11. We are getting frequent game crashes while playing Duck Game. I am wondering if it is a compatibility issue as the game is older. Any help would be GREATLY appreciated. Here is our most recent crash report: System.InvalidOperationException: An unexpected error has occurred. at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawUserIndexedPrimitives[T](PrimitiveType primitiveType, T[] vertexData, Int32 vertexOffset, Int32 numVertices, Array indexData, Int32 indexOffset, Int32 primitiveCount, VertexDeclaration vertexDeclaration, _D3DFORMAT indexFormat) at DuckGame.MTSpriteBatcher.FlushVertexArray(Int32 start, Int32 end) in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\Render\SpriteBatcher.cs:line 709 at DuckGame.MTSpriteBatcher.DrawBatch(SpriteSortMode sortMode) in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\Render\SpriteBatcher.cs:line 485 at DuckGame.MTSpriteBatch.End() in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\Render\MTSpriteBatch.cs:line 151 at DuckGame.Layer.End(Boolean transparent, Boolean isTargetDraw) in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\Layer.cs:line 897 at DuckGame.Layer.Draw(Boolean transparent, Boolean isTargetDraw) in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\Layer.cs:line 1154 at DuckGame.LayerCore.DrawLayers() in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\Layer.cs:line 381 at DuckGame.Level.DoDraw() in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\Level.cs:line 1081 at DuckGame.Level.DrawCurrentLevel() in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\Level.cs:line 198 at DuckGame.MonoMain.RunDraw(GameTime gameTime) in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\MonoMain.cs:line 2524 at DuckGame.MonoMain.Draw(GameTime gameTime) in C:\gamedev\duckgame_current_steam\duckgame\DuckGame\src\MonoTime\MonoMain.cs:line 2246 Last 8 Lines of Console Output: Creating ghost (1442) @received Activating NMItemSpawned (2044->2045)((0)(H)LawMac,76561198093753884)(16) @received Activating NMFireGun (2045->2046)((0)(H)LawMac,76561198093753884)(16) @sent Sent NMKillDuck (421)((0)(H)LawMac,76561198093753884)(16) Creating ghost (1443) @received Activating NMItemSpawned (2046->2047)((0)(H)LawMac,76561198093753884)(16) Creating ghost (8879) Creating ghost (8880) Date: 04/19/2024 03:58:56 Version: 1.1.7717.16376 Platform: Windows 10 (Steam Build 8782838)(SFX) Online: 1 (C,0.01582697) Mods: nomods Time Played: 00:39:02 (140607) Special Code: men20 Resolution: (A)1920x1080 (G)1920x1080 (Fullscreen(W))(RF 140420) Level: Content/levels/deathmatch/office01_8.lev Command Line:1.2KViews0likes3CommentsJoin return red in visual studio
Hi everyone, I am newbe in .NET Core, please info what's wrong in my code? i want to join query using EF, but inside the visual studio tools, my join query return red. please see attached image bellow: the join return underline red so i can't run the project. how to fixed it? Thankyou and best regards.46Views0likes0CommentsMaui How to upload a file to web API in .NET 9
Hi, everyone I'm trying to upload an image to an API from a maui project. But when I send the file, the response is always BadRequest. However the API works if I use Postman. I create a client in a console project and it worked. So I don't know why the same code in .NET MAUI it doesn't work. Problem is not in URI or something. I hope you could help me. Reegrets. Victor Cueto API throws the next exception: Microsoft.AspNetCore.Http.BadHttpRequestException: Required parameter "IFormFile image" was not provided from form file. at lambda_method3(Closure, Object, HttpContext, Object) at Microsoft.AspNetCore.Http.RequestDelegateFactory.<>c__DisplayClass103_2.<<HandleRequestBodyAndCompileRequestDelegateForForm>b__2>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context) code Minimal API: error:88Views0likes0CommentsDotnet core Oracle 23c SSL connection not working on Linux environment and works on Windows
Our data direct ADO.NET oracle driver is having an issue with SSL connection on Linux platform and the same connection is working on windows environment with Oracle23c server. Are there any known limitations with dotnet core on linux environment with SSL/TLS connections. Trace : InnerException: System.IO.IOException Message: Unable to read data from the transport connection: Connection reset by peer. Source: System.Net.Sockets Stack Trace at System.Net.Sockets.NetworkStream.Read(Span`1 buffer) at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory`1 buffer) at System.Net.Security.SslStream.Read(Byte[] buffer, Int32 offset, Int32 count) The same application works on Windows environment.292Views0likes3Comments🚀 Kickstart Your .NET Journey with Microsoft Learn!
Hey .NET enthusiasts! Are you new to .NET or looking to refresh your skills? Microsoft Learn has an Introduction to .NET module that walks you through the fundamentals of .NET, .NET Core, and the .NET Framework. This is a free, hands-on learning experience designed to get you started quickly. What you'll learn: The basics of .NET and why it's powerful How .NET supports multiple platforms Running your first .NET application Start learning here: Microsoft Learn Introduction to .NET Have you used .NET in your projects? Share your experiences and let’s discuss below!27Views0likes0CommentsSpecify locale/language for exception messages to user during runtime.
I am using VB 2022 with .NET 8 & 9. I develop applications that allow the user to specify which language they want the GUI elements to be displayed in while the application is running - regardless of what language the users' MS Windows profile is set to. The reason I do this is because some companies (mine included) require all systems to be set to the U.S. English (EN-US) regional/locale settings. This is very easy for me to achieve, even for expected user errors which I can head off. However, unexpected system error messages are always displayed in the English language because the system is set to the English language. Is there any known way to force unexpected error/exception messages to be displayed in a language other than the system's current language? If I knew every single possible error that could be thrown up, as well as its corresponding error code/number, I could create translations myself. But, unfortunately, I have no way of listing every possible system error that could be thrown up during runtime. It would be nice if Microsoft had a COMPLETE list of these somewhere. But every list I've seen is fragmented and incomplete, and sometimes doesn't include a corresponding error code with the message. Try 'Attempt the following block of code. '/////////////////////////////////////////////// ' E X E C U T E S O M E C O D E H E R E ! '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Catch e As System.Exception 'Trap any unexpected system error. MessageBox.Show(e.HResult.ToString & NewLine & e.Message, MyCaption, MessageBoxButtons.OK, MessageBoxIcon.Error) 'Display the error message to the user. End Try Even though the user's system is set to the English language, I want to be able to display the message passed in the 'e.Message' member from the codes sample in whatever language the user has specified their GUI to display in during that application's runtime. Any ideas how to achieve this? BTW... the ability to do this would be an AWESOME feature for Microsoft to add to future .NET releases.25Views0likes0CommentsNeed Advice on Asp.Net MVC project
Hey, I just need advice on my first project. I am highly frustrated rn. I dont know where to start. I am creating a web-application on Asp.Net MVC using Entity framework with SQL server Till now: I find the template and created the layout and index page on mvc Its only me on the project. Its about a week and i am really losing my mind how to connect each dots(specification). To complete my project. I have some question. I am sorry, i dont think, so this is the right platform for this or not. I dont want to waste anyone time here. Thanks for your time and consideration.560Views0likes2CommentsIssue with SignIn Key validation while using Orcid as External login Provider with Identity Server
Hi, I am working on integrating Orcid as second external login provider in my Identity Server based SSO application in Asp.Net Core. I have added necessary configurations in startup.cs file for Orcid provider as below services.AddAuthentication() .AddOpenIdConnect("ORCID", "ORCID", options => { options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme; options.SignOutScheme = IdentityServerConstants.SignoutScheme; options.ClientId = {myclientid}; options.ClientSecret = {myclientsecret}; options.Authority = {authorityurl}; options.ResponseType = "code"; options.Scope.Clear(); options.Scope.Add("openid"); // ORCID-specific scope for basic authentication options.Scope.Add("/authenticate"); options.CallbackPath = new PathString({myapplicationpath}); options.GetClaimsFromUserInfoEndpoint = true; options.SaveTokens = true; options.Configuration = new Microsoft.IdentityModel.Protocols. OpenIdConnect.OpenIdConnectConfiguration { AuthorizationEndpoint = "https://sandbox.orcid.org/oauth/authorize", TokenEndpoint = "https://sandbox.orcid.org/oauth/token", Issuer = "https://sandbox.orcid.org" }; options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters() { NameClaimType = "sub", RoleClaimType = "role" ValidateIssuer = true, ValidIssuer = "https://sandbox.orcid.org", ValidateIssuerSigningKey = true, ValidateAudience = false, // ORCID does not return 'aud' in ID token ValidateLifetime = true, RequireExpirationTime = true }; options.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "orcid"); options.ClaimActions.MapJsonKey(ClaimTypes.Name, "name"); options.ClaimActions.MapJsonKey(ClaimTypes.Email, "email"); options.Events.OnAuthorizationCodeReceived = authorizationCtx => { // access code thru authorizationCtx.TokenEndpointRequest.Code var code = authorizationCtx.TokenEndpointRequest.Code; return Task.FromResult(0); }; options.Events.OnTokenResponseReceived = tokenResponse => { var idToken = tokenResponse.TokenEndpointResponse?.IdToken; var accessToken = tokenResponse.TokenEndpointResponse.AccessToken; Console.WriteLine($"Access Token: {accessToken}"); Console.WriteLine($"ID Token: {idToken}"); // Handle the response manually to prevent further processing tokenResponse.HandleResponse(); // Redirect the user to the callback path (or another page) var callbackUrl = {mycallbackurl}; // Change this to your desired redirect URL tokenResponse.HttpContext.Response.Redirect(callbackUrl); return Task.FromResult(0); }; options.Events.OnRemoteFailure = ctx => { ctx.HandleResponse(); ctx.Response.Redirect("/error?message=" + ctx.Failure.Message); return Task.CompletedTask; }; }).AddJwtBearer(options => { options.Authority = "https://sandbox.orcid.org"; options.Audience = {myclientid}; options.RequireHttpsMetadata = true; }); I am able to login to Orcid and receives authorization code and further receive access token and id token in OnTokenResponseReceived event. But after continuing, gets signature validation error as below IDX10501: Signature validation failed. Unable to match keys: kid: {orcid keyid} token: {token keyid}.... I verified the signin keys at both end and they are correct Can anyone suggest the cause of the error and how to fix it? How can I validate the signin key and return back to my redirect url? Or suggest a complete flow on how to implement this integration. Thanks.42Views0likes0CommentsHow to stop "A potentially dangerous Request.Path" with "<"
Hello, I've been getting "A potentially dangerous Request.Path value was detected from the client (<)." recently and it is causing the application pools in IIS to stop working. The url they are trying to pass through is similar to this: https://test.com:443/cds/pubs/bib/<my_tag_9ac1214b650a30718aced57527fd64c4/> If users can past this URL at any point on my site, how can I stop it from constantly stopping my site and still being safe from SQL injection, Cross Site Scripting or some other vulnerability? Can I encode it before the page is processed so "<" becomes "<"? That way this will not be considered a dangerous Request.Path. Thank you67Views1like0Comments