Forum Widgets
Latest Discussions
Maui 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:VictorCueto3Feb 24, 2025Copper Contributor39Views0likes0CommentsVersioning my Maui Android App
Previously the way to define version code for Android in Maui .csproj file was like this: <!-- Versions --> <ApplicationVersion>3.1.2</ApplicationVersion> <AndroidVersionCode>3</AndroidVersionCode> With the new release of Visual Studio Preview, this has changed to: <ApplicationVersion>3</ApplicationVersion> It works, from Visual Studio, I can bundle a new .aab package (see image below). We see the version code is defined to 3. Unfortunately the version is defined to 1.0.0 and I don't know how to change this. ...when imported on the Google Play Console, it look like this: Unfortunately, when imported I only see the versionCode 3 (which is defined in the .csproj file as ApplicationVersion). What about the versionName (in parentheses) ? Nothing is planned in the .csproj file ? When imported on the Google Play Console, I don't want to have 3 (1.0.0) but I want 3 (3.1.2)... https://developer.android.com/studio/publish/versioning versionCode — A positive integer used as an internal version number. versionName — A string used as the version number shown to users.BronzatoFeb 11, 2025Copper Contributor25KViews0likes8CommentsGraph API getAsync() in C#
This is cross posted in Azure as well. If I use graph in a console application I get the information that I request. Such as test = await graphClient.Users.GetAsync(); If I try this in a WebMethod in the code behind of a page or in an .asmx, it never returns with the data. I know this has been mentioned before in many forums, but I did not have issues in V1.0 of the SDK. When I try to use V5+ I can't seem to get the information back. Any ideas on overcoming the issue? Any help would be great.MustangProgrammerJan 30, 2025Copper Contributor24Views0likes0Comments- SampsonYeJan 09, 2025Copper Contributor82KViews0likes7Comments
Console App To Write Data To CSV
I am trying to write a pre-defined list of headers to row 1, and List<string> results starting in row 2...my issue is that I get my pre-defined headers written as well as the headers from my List<string> ```cs void WriteResultsToCSV(List<VwExport> records, string fileName) { DateTime currentDate = DateTime.Now; string formattedDate = currentDate.ToString("MM-dd-yyyy"); var filePath = "/Users/owner/Downloads/" + fileName + formattedDate + ".csv"; // Define the headers var headers = new[] { "Job Num", "IM barcode Child", "IM barcode Parent", "ZYL_Presort", "Full Name" }; using (var writer = new StreamWriter(filePath, false, Encoding.UTF8)) using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) { foreach (var header in headers) { csv.WriteField(header); } csv.NextRecord(); var trimmedRecords = records.Select(record => new { JobNum = record.JobNum, IMBarcodeDigits = record.ImBarcodeDigits, IMBarcodeCharacters = record.ImBarcodeCharacters, OELPresort = record.OelPresort, FullName = record.FullName }).ToList(); csv.WriteRecords(trimmedRecords); } }```marksmanAK-2024Dec 26, 2024Copper Contributor25Views0likes0CommentsA strange run issue
I encountered a strange operational issue. After packaging my software in. msixbundle format, I installed and tested it locally. When clicking on the program icon in the start menu, an error occurred and a DLL could not be found. However, after confirmation, the main interface of the program can be opened. In fact, this DLL and the program's exe are in the same directory. But in the program files \ windows app \ myapp directory, clicking on this exe will allow the program to execute normally. My program is a. NET 8 winform program. How should I do?bill_quDec 19, 2024Copper Contributor13Views0likes0CommentsHow to print on Bluetooth printer in dotnet maui
Dear All Can any one tell mw how can I access Blutooth printer in dotnet maui. Can we use Bluetooth printer as COM/LPT port so that we can send text file to print on that port. Or we should use It as Binary writer to print any graphics or PDF file on it. ThanksashokhurkatDec 13, 2024Copper Contributor13KViews1like4CommentsMaui.NET and XCode validation
My application is developed on a Windows PC using Visual Studio 2022 (ver. 17.12.1) and .NET MAUI framework (ver. 9). After a successful build and testing using a virtual iPhone interface, Visual Studio connects remotely to the MacBook (Mac OS 15.1) sending the necessary project files to Xcode 16.1 targeting iOS version 18. The files are sent to Xcode successfully. However, Xcode validation fails with 4 errors. No matter what I change, the same errors persist. These validation errors are preventing me from deploying the code to TestFlight. Apple support refuses to help stating it is a problem with Visual Studio compilation of the package for Xcode. While I am not 100% confident, I suspect that the entries in the plist.info file contained within the project do not agree with where the files are physically located (even though they appear correct. However, I cannot see the key values in the plist file in the Xcode IPA package. I also notice that Maui opted to create entries in the plist.info file for “Assets.xcassets/AppIcon.appiconset”, but according to apple this is not how it should be done anymore. Could anyone provide the specific changes in detail that need to happen to this project to have a successful XCode validation? I have been at this for two weeks with no solution in site. Below is a link to the referenced resources. Screenshots and Error documents Your help is greatly appreciatedmrwww76Dec 02, 2024Copper Contributor93Views0likes0CommentsAutomation testing for ToastNotifications
I am testing a WPF application, and I want to access a button on a Toast Notification. I am using the Microsoft UI Automation framework, but cannot locate the Notification window in the RawView tree or from the RootElement (.Find*). However tools like Inspect do find the Notification window. => what is the issue here? I could use NotificationListener, but that doesn't give access to any button. Correct me if I'm wrong. So how can I access those Toast Notifications with MS UI Automation?deschatrNov 29, 2024Copper Contributor60Views0likes0Comments
Resources
Tags
- .NET MAUI148 Topics
- Windows Forms63 Topics
- android52 Topics
- ios36 Topics
- Xamarin.Forms33 Topics
- Blazor32 Topics
- Console Apps26 Topics
- WPF25 Topics
- macos17 Topics
- UWP17 Topics