Recent Discussions
React website with ASP.NET and IIS : API not working
Hi, I have found a lot of similar issues on the web but none was working for me, and I am so desperate after days so I am posting here and hope someone can help. I have an ASP.NET server that serves a React website, and also works as an API for the website itself. The server runs on a Windows 11 PC with IIS, in C:/MyWebSite. This folder contains the ASP.NET server (.exe, .dll, etc), the IIS configuration (web.config) and the build React website (index.html, favicon.ico and assets folder). The server succeed to show my main page, but it fails doing an API request. The API request fails as well when I call it from Postman, and gives me the error "HTTP 404.0 - Not Found" with these details : Module IIS Web Core Notification : MapRequestHandler Handler : StaticFile Error code : 0x80070002 FYI, the request is GET http://localhost:5058/api/configuration/settings Concerning ASP.NET, here is my Program.cs : using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens; using System.Text; // Create the web application builder var builder = WebApplication.CreateBuilder(args); // JWT authentication builder.Services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; }) .AddJwtBearer(options => { string? tKey = builder.Configuration["Jwt:Key"]; options.TokenValidationParameters = new TokenValidationParameters { ValidateIssuer = true, ValidateAudience = true, ValidateLifetime = true, ValidateIssuerSigningKey = true, ValidIssuer = builder.Configuration["Jwt:Issuer"], ValidAudience = builder.Configuration["Jwt:Audience"], IssuerSigningKey = tKey != null ? new SymmetricSecurityKey(Encoding.UTF8.GetBytes(tKey)) : null }; }); // Add the controllers to the application (for input http requests) builder.Services.AddControllers(); // Configure CORS policy builder.Services.AddCors(options => { options.AddPolicy("AllowAllOrigins", builder => { builder.AllowAnyOrigin() .AllowAnyHeader() .AllowAnyMethod(); }); }); // Create the App var app = builder.Build(); // Applies the CORS policy app.UseCors("AllowAllOrigins"); // Serving the static files app.UseDefaultFiles(); app.UseStaticFiles(); app.UseRouting(); // Map the routes to the controllers app.MapControllers(); // Undefined route will lead to index.html app.MapFallbackToFile("index.html"); // Run the App app.Run(); Of course, I have created some controllers, here is ConfigurationController.cs for example : using Microsoft.AspNetCore.Mvc; namespace AspReact.Server.Controllers { [ApiController] [Route("api/configuration")] public class GeneralController : ControllerBase { [HttpGet("settings")] public ActionResult GetSettings() { return Ok(new { language = 'fr', theme = 0 }); } [HttpPost("settings")] public ActionResult SetSettings([FromQuery] string language, [FromQuery] string theme) { m_tLanguage = language; m_tTheme = theme; return Ok(); } } } Here is my IIS configuration : <?xml version="1.0"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="React Routes" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /> </conditions> <action type="Rewrite" url="/" /> </rule> </rules> </rewrite> </system.webServer> </configuration> NB : At first I was not doing : <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /> And the API request was returning the content of index.html... If it can help. Please note that all this is working during development with the server running in a debug console. I would be grateful for any help! Thanks.Solved86Views0likes2CommentsDynamic form generation from dictionary
ASP.NET Blazor app brand spanking new to the stuff here. Trying a move from Apache PHP. Trying to create a dynamic form from a dictionary generated from a separate class I've banged my head against the wall for hours and can't get past this point. This makes everything a text box.. and When its done this way I can see the data change from the submit method. Any time I try to create a bool (checkbox) or number field I get conversion errors or worse. That dictionary _registry.Fields.FieldsData looks like. (converted to JSON to use here) { "ID": { "ID": "47", "fld_app": "5", "fld_human": "ID", "fld_column": "ID", "fld_enable": "True", "fld_type": "int", "fld_pdotype": "", "fld_length": "NULL", "fld_precision": "", "fld_pass": "", "fld_opt": "False", "fld_opt_table": "", "fld_opt_column": "", "fld_icon_set": "", "fld_regex": "", "fld_uom": "", "fld_placeholder": "", "fld_usr_ID": "False", "fld_link": "", "fld_index": "True", "fld_detail": "True", "fld_form": "True", "fld_order": "1", "fld_title": "False", "fld_required": "False", "fld_double": "False", "fld_encrypt": "False", "fld_time": "False", "fld_image": "False", "fld_unique": "False", "fld_json": "False" }, "Column1": { "ID": "48", "fld_app": "5", "fld_human": "Column1", "fld_column": "Column1", "fld_enable": "True", "fld_type": "nvarchar", "fld_pdotype": "", "fld_length": "50", "fld_precision": "", "fld_pass": "", "fld_opt": "False", "fld_opt_table": "", "fld_opt_column": "", "fld_icon_set": "", "fld_regex": "", "fld_uom": "", "fld_placeholder": "", "fld_usr_ID": "False", "fld_link": "", "fld_index": "True", "fld_detail": "True", "fld_form": "True", "fld_order": "2", "fld_title": "False", "fld_required": "False", "fld_double": "False", "fld_encrypt": "False", "fld_time": "False", "fld_image": "False", "fld_unique": "False", "fld_json": "False" }, "Column2": { "ID": "49", "fld_app": "5", "fld_human": "Column2", "fld_column": "Column2", "fld_enable": "True", "fld_type": "nvarchar", "fld_pdotype": "", "fld_length": "50", "fld_precision": "", "fld_pass": "", "fld_opt": "False", "fld_opt_table": "", "fld_opt_column": "", "fld_icon_set": "", "fld_regex": "", "fld_uom": "", "fld_placeholder": "", "fld_usr_ID": "False", "fld_link": "", "fld_index": "True", "fld_detail": "True", "fld_form": "True", "fld_order": "3", "fld_title": "False", "fld_required": "False", "fld_double": "False", "fld_encrypt": "False", "fld_time": "False", "fld_image": "False", "fld_unique": "False", "fld_json": "False" }, "Column3": { "ID": "50", "fld_app": "5", "fld_human": "Column3", "fld_column": "Column3", "fld_enable": "True", "fld_type": "nvarchar", "fld_pdotype": "", "fld_length": "50", "fld_precision": "", "fld_pass": "", "fld_opt": "False", "fld_opt_table": "", "fld_opt_column": "", "fld_icon_set": "", "fld_regex": "", "fld_uom": "", "fld_placeholder": "", "fld_usr_ID": "False", "fld_link": "", "fld_index": "True", "fld_detail": "True", "fld_form": "True", "fld_order": "4", "fld_title": "False", "fld_required": "False", "fld_double": "False", "fld_encrypt": "False", "fld_time": "False", "fld_image": "False", "fld_unique": "False", "fld_json": "False" }, "Column4": { "ID": "51", "fld_app": "5", "fld_human": "Column4", "fld_column": "Column4", "fld_enable": "True", "fld_type": "nvarchar", "fld_pdotype": "", "fld_length": "50", "fld_precision": "", "fld_pass": "", "fld_opt": "False", "fld_opt_table": "", "fld_opt_column": "", "fld_icon_set": "", "fld_regex": "", "fld_uom": "", "fld_placeholder": "", "fld_usr_ID": "False", "fld_link": "", "fld_index": "True", "fld_detail": "True", "fld_form": "True", "fld_order": "5", "fld_title": "False", "fld_required": "False", "fld_double": "False", "fld_encrypt": "False", "fld_time": "False", "fld_image": "False", "fld_unique": "False", "fld_json": "False" }, "Column5": { "ID": "52", "fld_app": "5", "fld_human": "Column5", "fld_column": "Column5", "fld_enable": "True", "fld_type": "nvarchar", "fld_pdotype": "", "fld_length": "50", "fld_precision": "", "fld_pass": "", "fld_opt": "False", "fld_opt_table": "", "fld_opt_column": "", "fld_icon_set": "", "fld_regex": "", "fld_uom": "", "fld_placeholder": "", "fld_usr_ID": "False", "fld_link": "", "fld_index": "True", "fld_detail": "True", "fld_form": "True", "fld_order": "6", "fld_title": "False", "fld_required": "False", "fld_double": "False", "fld_encrypt": "False", "fld_time": "False", "fld_image": "False", "fld_unique": "False", "fld_json": "False" }, "Column6": { "ID": "53", "fld_app": "5", "fld_human": "Column6", "fld_column": "Column6", "fld_enable": "True", "fld_type": "nvarchar", "fld_pdotype": "", "fld_length": "50", "fld_precision": "", "fld_pass": "", "fld_opt": "False", "fld_opt_table": "", "fld_opt_column": "", "fld_icon_set": "", "fld_regex": "", "fld_uom": "", "fld_placeholder": "", "fld_usr_ID": "False", "fld_link": "", "fld_index": "True", "fld_detail": "True", "fld_form": "True", "fld_order": "7", "fld_title": "False", "fld_required": "False", "fld_double": "False", "fld_encrypt": "False", "fld_time": "False", "fld_image": "False", "fld_unique": "False", "fld_json": "False" } } The .razor component PAGE "/FieldsAdmin" @inject ILogger<FieldsAdmin> Logger @inject portalx.Classes.Main.DBO Database @using System.Data @using System.Collections.Generic @inject portalx.Classes.Main._reg _registry @using System.Text.Json <form method="post" @onsubmit="Submit" @formname="FieldsAdmin"> <AntiforgeryToken /> @if (_registry.Fields.FieldsData != null) { @foreach (var row in _registry.Fields.FieldsData) { <div class="form-row"> @foreach (var field in row.Value) { <div class="form-group col-md-6"> <label>@field.Key</label> @{ var key = $"{row.Key}-{field.Key}"; if (!Model!.DynamicFields.ContainsKey(key)) { Model!.DynamicFields[key] = field.Value?.ToString() ?? string.Empty; } } <InputText @bind-Value="Model!.DynamicFields[key]" /> </div> } </div> } } <div> <button type="submit">Submit</button> </div> </form> <div> <h3>Fields Data (JSON)</h3> <pre>@jsonString</pre> </div> @code { [SupplyParameterFromForm] private ModelFieldsAdmin? Model { get; set; } private Dictionary<string, string> dataDict { get; set; } private string jsonString { get; set; } protected override void OnInitialized() { Model ??= new(); dataDict = new Dictionary<string, string> { { "ID", "hidden" }, { "fld_app", "skip me" }, { "fld_human", "text" }, { "fld_column", "skip me" }, { "fld_enable", "bool" }, { "fld_type", "skip me" }, { "fld_pdotype", "skip me" }, { "fld_length", "skip me" }, { "fld_precision", "skip me" }, { "fld_pass", "bool" }, { "fld_opt", "bool" }, { "fld_opt_table", "text" }, { "fld_opt_column", "text" }, { "fld_icon_set", "text" }, { "fld_regex", "text" }, { "fld_uom", "text" }, { "fld_placeholder", "text" }, { "fld_usr_ID", "bool" }, { "fld_link", "bool" }, { "fld_index", "bool" }, { "fld_detail", "bool" }, { "fld_form", "bool" }, { "fld_order", "number" }, { "fld_title", "bool" }, { "fld_required", "bool" }, { "fld_double", "bool" }, { "fld_encrypt", "bool" }, { "fld_time", "bool" }, { "fld_image", "bool" }, { "fld_unique", "bool" }, { "fld_json", "bool" } }; jsonString = JsonSerializer.Serialize(_registry.Fields.FieldsData, new JsonSerializerOptions { WriteIndented = true }); } private void Submit() { foreach (var kvp in Model!.DynamicFields) { Logger.LogInformation("Field Key: {Key}, Value: {Value}", kvp.Key, kvp.Value); } } public class ModelFieldsAdmin { public string? Id { get; set; } public Dictionary<string, string> DynamicFields { get; set; } = new Dictionary<string, string>(); } }Solved63Views0likes1Commentajax and connection to mvc .net
I need to access some c# code from javascript in MVC ,NET (not blazor). I have the below. This is very specific to .NET and MVC stack and not a generic ajax question like another one in stack overfow. I get no error message it just continues to the next statement after the ajax call. There could be 2 possible issues i think. My url: '/Home/CreatePostcodeFromCoordinates', is wrong. Or my C# assembly is not part of the assembly? or something similar. I am not that experienced with Web techs, I come from a DB background but can't be that difficult to get this link working right? Can't see anything else wrong. Also does the return value from C# need to be some special format or a string (as per now) is ok? this could be another reason? Thank you! console.log("just before /Home/CreatePostcodeFromCoordinates"); $.ajax({ type: "POST", url: '/Home/CreatePostcodeFromCoordinates', data: { param1: longitude, param2: latitude }, success: function (response) { console.log('success'); console.log(response); }, error: function (error) { console.error(error); } });Solved107Views0likes1CommentCheckbox values empty if other form fields are empty when POST form
I have hit a road block on a ASP.NET/Razor Pages project I am working on. I have a form with checkboxes. I have a List<int> field that is bound to the Id of the checkboxes. If I submit the form with only the checkboxes checked the List is always null. However, if I type text in a textbox in the form before submitting, the checkbox values are POST'd correctly. Looking for any hints on things to try or check to to help me narrow down the problem. Thank for any suggestions.Solved236Views0likes2CommentsEF Core : foreign key column with same name as existing navigation property
Iwant to use EF Core to map a legacy database. I cannot scaffold as there are hundreds of tables and I am only interested in very few and besides scaffolding generates names for the navigation properties which are not the ones I want. The situation is: I have a required many-to-one relationship linked by a column name that matches the name of the property that I want to give. The code (simplified) is: public class EntityProperty { public ControlType ControlType { get; set; } } public class ControlType { public List<EntityProperty> Properties { get; set; } = new List<EntityProperty>(); } Nothing more is required, eg, I'm not using foreign key properties, just navigation. The problem is, the foreign key column from theEntityPropertiestable to theControlTypesis also calledControlType. So, when I try to map it as: builder.HasOne(x => x.ControlType) .WithMany(x => x.Properties) .IsRequired() .HasForeignKey("ControlType"); I want to use EF Core to map a legacy database. I cannot scaffold as there are hundreds of tables and I am only interested in very few. The situation is: I have a required many-to-one relationship linked by a column name that matches the name of the property that I want to give. The code (simplified) is: public class EntityProperty { public ControlType ControlType { get; set; } } public class ControlType { public List<EntityProperty> Properties { get; set; } = new List<EntityProperty>(); } The problem is, the foreign key column from theEntityPropertiestable to theControlTypesis also calledControlType. So, when I try to map it as: builder.HasOne(x => x.ControlType) .WithMany(x => x.Properties) .IsRequired() .HasForeignKey("ControlType"); I get the following exception: InvalidOperationException: The property or navigation 'ControlType' cannot be added to the 'EntityProperty' type because a property or navigation with the same name already exists on the 'EntityProperty' type.' The problem is with HasForeignKey, I guess it's because I am adding a shadow property when a "physical" property already exists, but I what I really mean to say is to use a different column name to link the two entities: what I want is to be able to specify a "not standard" column name for the foreign key, which I am not able to. I do not have a foreign key property, only a navigation property, and I do not want to have one.Solved1.7KViews0likes1CommentMSB4011 warnings
Got a project with 2 of these warnings and it seems there's nothing I can do in VS to fix these. Where does it come from and how to solve it ? All I see when showing all files is a Imports folder with subfolders that seems to be links and there's nothing I can do with them in this project. The weird part is that from 12 projects in my solutions only this project exhibit this issue. I wish I could remove these warnings or know how to fix them Severity Code Description Project File Line Suppression State Warning MSB4011 "C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.Publish\Sdk\Sdk.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.Worker\targets\Microsoft.NET.Sdk.Worker.props (50,3)". This is most likely a build authoring error. This subsequent import will be ignored. waInvoiceSystem 1 Severity Code Description Project File Line Suppression State Warning MSB4011 "C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.Publish\Sdk\Sdk.targets" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.Worker\targets\Microsoft.NET.Sdk.Worker.targets (24,3)". This is most likely a build authoring error. This subsequent import will be ignored. waInvoiceSystem 1Solved1.1KViews0likes3CommentsException in .Net MAUI App: "System.ObjectDisposedException: Cannot access a closed Stream" on Andro
I am currently developing a .Net MAUI application where I am making an HTTP call. The peculiar issue I am facing is that the function works perfectly fine on Windows, but when I attempt to execute it on my Local Android Device, it throws an exception after line var response = await client.PostAsync(url, content); > "System.ObjectDisposedException: Cannot access a closed Stream." ``` public async static Task InsertParts(IEnumerable<PartDTO> partsToReport) { using (HttpClient client = GetClient()) { AddAuthorizationHeader(client); string url = $"{Url}/endpoint"; string jsonData = JsonSerializer.Serialize(partsToReport); HttpContent content = new StringContent(jsonData, Encoding.UTF8, "application/json"); var response = await client.PostAsync(url, content); if (!(response.IsSuccessStatusCode)) { throw new Exception($"Failed to insert parts: {response.ReasonPhrase}"); } } } ``` ``` public static HttpClient GetClient() { #if DEBUG HttpClientHandler insecureHandler = new HttpClientHandler(); insecureHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; return new HttpClient(insecureHandler); #else return new HttpClient(); #endif } ``` GET and DELETE works on both platforms The Post operation like this works on both platforms > HttpResponseMessage response = await client.PostAsync($"{Url}/inventory/{id}/{destination}", null); but when I try to put content in the request then it does not work on android but works in Windows.Solved2.5KViews0likes2CommentsForm1 Rename Problem in Visual Studio
If you create a Windows Forms project in Visual Studio 2022, it creates a Form1.cs file, a Form1.cs [Design] form, and a Form1.Designer.cs file. You can then drag items from the toolbox onto the form or select the form and using the form properties window to add event handlers like OnPaintForm1, and the Designer will handle those actions appropriately. However, if after creating the project, you immediately rename Form1.cs and its counterparts to, say, MyForm.cs, etc. and then drag items from the toolbox to the form or select the form and use the properties window to add event handlers, the Designer does not appropriately update the renamed form files or form design. What I have to do is use the original Form1 files, add the tools and event handlers, and build the application. After that, I can rename the files and they still work. Is there a way to fix the problem of renaming first?Solved1.3KViews0likes3CommentsInspect the visual tree of a .NET MAUI app IS NOT WORKING!
I am attempting to Inspect a Visual Tree in Windows Maui App and it does not work. Followed the instruction provided on this web page https://learn.microsoft.com/en-us/dotnet/maui/user-interface/live-visual-tree?view=net-maui-7.0&tabs=vswin#find-a-ui-elementInspect the visual tree of a .NET MAUI app I am attempting to see the properties for an element and nothing shows up? It works if I use a WPF Project but not in a MAUI project. Please HelpSolved1.1KViews0likes2CommentsMicrosoft.ACE.OLEDB.12.0 Issue
So I have a C# app that reads from Excel (using Microsoft.ACE.OLEDB.12.0) in order to then add those rows into a larger consolidated sheet. It's worked fine for a long time. Suddenly the past couple of weeks I received trouble reports from endusers that the app isn't functioning. When I debugged it, seems that the Excel source files have zero rows read. No runtime errors or anything. I have verified that the column headings are correct, against theOleDbCommand.CommandText query. And the column headings are based on a generic template that all of these source sheets use. The source sheets have rows of valid data. A year or two ago I recall there was a Windows Update that affected some of these Excel OLEDB operations. Due to MDAC era components being deprecated. Hence why I changed over to ACE OLEDB 12.0. Since I did that this app has run without fail. Anyone know if there was indeed a Windows Update that would've affected things? Running this on Windows 10 Pro. I can provide my source code, although it's been unmodified and is relatively verbose.Solved1.2KViews0likes1CommentDeveloping a .NET MAUI app on a team using Visual Studio on both Windows and Mac
As the title states, our team consists of developers who use Visual Studio 2022 for Mac and for Windows. We are creating a cross-platform application using .NET MAUI, so I'd assume we should be able to contribute using both. However, we seem to have a problem in our .csproj file. In order for the application to load in the solution on Windows machines, the .csproj file must include these lines: <TargetFrameworks>net7.0-windows10.0.19041.0</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('mac'))">$(TargetFrameworks);net7.0-maccatalyst</TargetFrameworks> However, in order for them to load on Visual Studio for Mac, we must have these lines: <TargetFrameworks>net7.0-maccatalyst</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks> Is there any configuration we can put that will allow the project to load on either operating system? As the minority OS user, it is quite annoying to have to edit the .csproj each time I switch git branches.Solved560Views0likes1CommentCould not set or bind model property with Bootstrap Datepicker in Blazor
I am using bootstrap datepicker and the problem is that when I pick a date, it does not fire a change or input event and noting is binding with the model propertyCourse.StartDateorCourse.EndDate. The default datepicker works but does not support Afghanistan datetime. That is why I use boostrap datepicker. Blazor code: @using Microsoft.AspNetCore.Mvc.Rendering @using myproject.Data @using Microsoft.JSInterop; @inject myproject.Repository.CoursesRepository _coursesRepository @inject IJSRuntime JS <EditForm Model="@Course" OnValidSubmit="e=> { if(selectedId == 0) { addCourse(); } else { updateCourse(Course.CourseId); } }"> <div class="mb-2"> <div>@Course.StartDate</div> <label class="col-form-label" for="StartDate">@Loc["Start Date"]<span class="text-danger fs--1">*</span>:</label> <InputDate class="form-control" @bind-Value="Course.StartDate" @bind-Value:format="yyyy-MM-dd" id="StartDate" /> <ValidationMessage class="text-danger" For="(() => Course.StartDate)"/> </div> <div class="mb-2"> <label class="col-form-label" for="EndDate">@Loc["End Date"]<span class="text-danger fs--1">*</span>:</label> <InputDate class="form-control" @bind-Value="Course.EndDate" @bind-Value:format="yyyy-MM-dd" id="EndDate"/> <ValidationMessage class="text-danger" For="(() => Course.EndDate)"/> </div> </EditForm> @code { public CourseModel Course = new(); public string[] dates = new string[] { "#StartDate", "#EndDate" }; protected override void OnAfterRender(bool firstRender) { base.OnAfterRender(firstRender); loadScripts(); } void addCourse() { _coursesRepository.AddCourse(Course); FillData(); Course = new(); var title = "Course"; Swal.Success(title : Loc[$"{title} added successfully"],toast : true); } // initializes the datepicker public async Task loadScripts() { await JS.InvokeVoidAsync("initializeDatepicker", (object) dates); } } This is script for initializing the datepickers <script> function initializeDatepicker(dates) { dates.forEach((element) => { $(element).datepicker({ onSelect: function(dateText) { // this is not working element.value = this.value; /* tried this and still not working $(element).trigger("change"); also tried this and still not working $(element).change(); */ // this is working console.log("Selected date: " + dateText + "; input's current value: " + this.value); }, dateFormat: 'yy-mm-dd', changeMonth: true, changeYear: true }); }); } </script>Solved4.6KViews0likes2CommentsBoolean property true by default !?
I created a class with a Boolean. When I instantiate it, my Boolean is true. I don't understand. I thought the default for Boolean was false ! Any ideas ? Right now, I'm forced to use this attribute : [DefaultValue(false)] public bool IsDelete { get; set; }Solved2.5KViews0likes2CommentsScrapping and Automation
Hey There! Basically, I want to make a website that can scrape data from other websites without using an API in the same way that cURL in PHP scrapes data from other websites. I would like to know if it is possible to do this type of programming in ASP.net .My final year project will be a ASP.net project that focuses on automation and that I wish to do in ASP.net. Thanks.Solved852Views0likes2CommentsMAUI XAML "in-app toolbar" / "xaml inspector" no longer visible
Sorry for using some made up term but I have no idea what this little menu is called. So I referred to it as "xaml Inspector" I have 2 systems opening the same project, one is 17.3 preview 6 and the other is 17.3.2. On the preview version I can see this menu when I debug my MAUI app in Windows. I cannot see it on the 17.3.2 release, which seems to also be part of a wider debugging issue that I'm experiencing. Any idea how to fix this? Maybe I have changed a setting somewhere but am not aware of what. Thanks in advance!Solved1.5KViews1like2CommentsPassing variable to custom controls .NET MAUI
So I'm working on an application that allows the user to create a note and attach it to various entities. Because of this I created the note creation as a ContentView in my .NET MAUI project then I can display it wherever I need it instead of recreating it each time. Is there a way to pass a variable (i.e. contact id from the create contacts page) to the ContentView? 4 days of digging and so far haven't found anything close.Solved3.2KViews0likes2CommentsIssue with unexpected capability Microsoft.storeFilter.core.notSupported_8wekyb3d8bbwe
Dear comunity, we are preparing an update of our app on the Microsoft partner Center portal. After uploading the new “.appxupload” package, in addition to the capabilities we defined in the app manifest, we also find the following capability: "Microsoft.storeFilter.core.notSupported_8wekyb3d8bbwe" We tried to execute again the app build, also verifying the app manifest, but we still obtain such extra capability that seems to be added after the upload of “.appxupload” package. We also tried to search in the Web for it, but we didn’t get any clarification. Can you please provide us clarifications about such extra capability? Can be an issue during review phase for the app we have to release? Thank you in advance, Kind regards,Solved1.1KViews0likes2CommentsBuild error MT0057 for .net Maui iOS, Mac Catalyst builds with no problem
I can build and run for Mac Catalyst fine with this command dotnet build -t:Run -f net6.0-maccatalyst MyApp.csproj but when I try to build for iOS using this command dotnet build -t:Run -f net6.0-ios -p:_DeviceName=:v2:udid=********-************** MyApp.csproj I get this error EXEC : error MT0057: Cannot determine the path to Xcode.app from the sdk root '/Library/Developer/CommandLineTools'. Please specify the full path to the Xcode.app bundle. [/Users/chris/Documents/Development/MyApp/src/MyApp/MyApp.csproj] /usr/local/share/dotnet/sdk/6.0.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(897,5): error MSB3073: The command "/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.302-preview.14.122/tools/bin/mlaunch --launchsim bin/Debug/net6.0-ios/iossimulator-x64/MyApp.app/ --device :v2:udid=********-************ --stdout /dev/ttys000 --stderr /dev/ttys000 --wait-for-exit" exited with code 1. [/Users/chris/Documents/Development/MyApp/src/MyApp/MyApp.csproj] It is odd that it can find XCode for Catalyst but cannot find it for iOS. Any help would be appreciated.Solved2KViews0likes2CommentsBest practice to fill one column with manipulated values from another (DataFrame)?
C# 10 / .NET 6 / Microsoft.Data.Analysis Given aMicrosoft.Data.AnalysisDataFramewith two columns, what is the idiomatic way to take values from one column, manipulate them, then use the resulting value to fill the rows of the second column element-wise? // Create a DateTime column. PrimitiveDataFrameColumn<DateTime> dateTimeCol = new("Dates", 0); // Fill it. dateTimeCol.Append(DateTime.Now + TimeSpan.FromDays(1)); dateTimeCol.Append(DateTime.Now + TimeSpan.FromDays(2)); dateTimeCol.Append(DateTime.Now + TimeSpan.FromDays(3)); // Create a Ticks column. PrimitiveDataFrameColumn<long> ticksCol = new("Ticks", dateTimeCol.Length); // Create a DataFrame of the above two columns. DataFrame df = new(); df.Columns.Add(dateTimeCol); df.Columns.Add(ticksCol); At this point, what I want to do isdf["Ticks"] = df["Dates"].Ticks. Of course, this doesn't work. I could do this: for (int i = 0; i < df.Rows.Count; i++) { DateTime tempDate = (DateTime) df[i, df.Columns.IndexOf("Dates")]; df[i, df.Columns.IndexOf("Ticks")] = tempDate.Ticks; } But... is there a better way?Solved2.5KViews0likes4Comments