.NET Smart Components: Revolutionizing UI with AI Power

No Comments »

In the ever-evolving world of software development, .NET smart components are causing a revolution in user interface design. These innovative tools combine the power of artificial intelligence with the flexibility of .NET components, offering developers a new way to create dynamic and responsive user interfaces. As you explore the possibilities of smart components, you’ll discover how they can transform your approach to building intuitive and efficient applications.

You’ll gain insights into the key features that set .NET smart components apart from traditional UI elements. We’ll walk you through the process of implementing these AI-powered components in your projects, highlighting best practices and potential pitfalls to watch out for. Additionally, you’ll learn about the impact of smart components on development workflows and user experiences. By the end of this article, you’ll have a solid understanding of how .NET smart components can boost your productivity and take your applications to the next level.

Understanding .NET Smart Components

What are .NET Smart Components?

.NET Smart Components are pre-built, AI-powered UI elements designed to enhance your web applications quickly and easily. These components allow you to add genuinely useful AI features to your .NET apps without spending weeks redesigning your user experience or delving into complex machine learning and prompt engineering. By simply dropping these components into your existing user interfaces, you can upgrade your app’s functionality and make your users more productive.

The AI-powered revolution in UI development

Smart Components are causing a revolution in UI development by combining the power of artificial intelligence with the flexibility of .NET components. They offer a range of features that can significantly improve user experience and productivity:

  1. SmartPaste: A button that automatically fills out forms using data from the user’s clipboard, helping users add information from external sources without retyping.
  2. SmartTextArea: An intelligent upgrade to the traditional textarea that autocompletes whole sentences using your preferred tone, policies, and URLs.
  3. SmartComboBox: An enhanced version of the traditional combobox that makes suggestions based on semantic matching, helping users find what they’re looking for more easily.
  4. Local Embeddings: A general capability you can use to power your own features, such as search or retrieval-augmented generation (RAG).

These components are designed to work with ASP .NET Core 6.0 and later, supporting both Blazor and MVC/Razor Pages.

Current experimental status

It’s important to note that .NET Smart Components are currently an experiment from the .NET team. The purpose of this experiment is to assess how the .NET community would use pre-built UI components for AI features. The components are not yet an officially supported part of .NET, and their future support depends on community feedback and usage levels.

To help shape the future of these components, you’re encouraged to share your thoughts by filling out the .NET Smart Components survey. Your feedback will be crucial in determining whether Smart Components graduate to full support and what additional capabilities might be added in the future.

As the experiment progresses, the set of components and features may expand over time. The .NET team is also considering providing components for other .NET UI frameworks, such as .NET MAUI, WPF, and Windows Forms.

Key Features of .NET Smart Components

.NET Smart Components offer a range of innovative features that can significantly enhance your web applications. These AI-powered tools are designed to boost productivity and improve user experience without requiring extensive redesigns or complex machine learning implementations.

Smart Paste: Automating form filling

Smart Paste is a powerful feature that allows users to automatically fill out forms using data from their clipboard. This intelligent button can be easily integrated into any existing form in your web application, making it a versatile addition to your user interface.

Here’s how Smart Paste works:

  1. Users copy information from an external source, such as an email or document.
  2. They click the Smart Paste button in your application.
  3. The system automatically populates relevant form fields with the copied data.

For example, if a user copies a mailing address, Smart Paste can fill out separate fields for name, address lines, city, and state without manual typing or individual copy-paste actions. This feature is particularly useful for:

  • Creating new issues in bug tracking systems
  • Populating customer information in CRM applications
  • Filling out support ticket forms

Smart Paste is designed to work with any form without requiring specific configuration or annotations. The system intelligently infers field meanings from your HTML, though you can provide optional annotations for improved results.

Smart TextArea: Intelligent text completion

Smart TextArea is an AI-powered upgrade to the traditional textarea element. It offers suggested autocompletions for whole sentences based on its configuration and the user’s current input. This feature is particularly beneficial for:

  • Customer support systems
  • Live chat interfaces
  • CRM applications
  • Bug tracking systems

The key advantage of Smart TextArea is its ability to incorporate your preferred tone, policies, and specific phrases into suggestions. This helps maintain consistency in communication while allowing flexibility for your team.

For instance, in an HR system, typing “Your vacation allowance is” might prompt a suggestion like “28 days as detailed in our policy at https://…/policies/vacation”.

Smart ComboBox: Semantic suggestion engine

Smart ComboBox enhances the traditional combo box by offering semantic matches instead of just exact substring matches. This upgrade significantly improves user experience, especially when users are unsure of the exact predefined string they’re looking for.

Key benefits of Smart ComboBox include:

  1. Improved search functionality
  2. Reduced data entry errors
  3. Enhanced user efficiency

For example, in an expense tracking app, typing “plane tic” might suggest “Transport: Airfare” as the correct accounting category. Similarly, in a bug tracking system, entering “slow” could prompt suggestions like “Performance” or “Usability” for issue labels.

Smart ComboBox uses embeddings to achieve semantic matching, converting natural language strings into numerical vectors for comparison. This process can be performed efficiently on your server without requiring a GPU.

By incorporating these Smart Components into your .NET applications, you can significantly enhance user productivity and streamline data entry processes.

Implementing .NET Smart Components

Setting up the development environment

To start using .NET Smart Components, you need to have the latest version of the .NET framework installed. Begin by ensuring you have a current .NET SDK for Windows, Linux, or Mac. For ASP .NET Core 6.0 and later, you can use these components with either Blazor or MVC/Razor Pages.

To set up your environment:

  1. Create a new Blazor project or use an existing one ( .NET 6 or later).
  2. Install the required NuGet packages:
    • For the server project: SmartComponents.AspNetCore
    • For WebAssembly projects: SmartComponents.AspNetCore.Components

Integrating components into existing apps

Once your environment is set up, you can start integrating .NET Smart Components into your application. Here’s how to do it:

  1. Register Smart Components in your Program.cs file:
    builder.Services.AddSmartComponents();
  2. Configure the OpenAI backend if you’re using SmartPaste or SmartTextArea.
  3. Add components to your pages. For example:
    <SmartPasteForm>
    <InputField Name=”ProjectName” />
    <InputField Name=”StartDate” />
    <InputField Name=”EndDate” />
    </SmartPasteForm>

Best practices for optimal performance

To get the most out of .NET Smart Components:

  1. Leverage existing codebases: These components are designed to integrate seamlessly with your current projects, reducing the need for extensive modifications.
  2. Optimize resource usage: Smart Components use advanced algorithms and machine learning models to minimize latency and improve overall application performance.
  3. Explore official documentation: Microsoft provides extensive guides, code examples, and online courses to help you understand and implement these components effectively.
  4. Gather user feedback: As these components are still experimental, collect and share user experiences to help shape their future development.

Conclusion

.NET Smart Components are causing a revolution in UI development, offering developers powerful tools to enhance their applications with AI capabilities. These components, including SmartPaste, SmartTextArea, and SmartComboBox, have a significant impact on streamlining data entry, improving user experiences, and boosting overall productivity. By integrating these tools into existing .NET projects, developers can quickly upgrade their apps without extensive redesigns or complex machine learning implementations.

As this technology continues to evolve, it’s crucial for developers to stay informed and provide feedback to shape its future. The experimental status of these components presents an exciting chance to explore new possibilities in AI-powered UI design. By embracing .NET Smart Components, developers can stay ahead of the curve and create more intuitive, efficient applications that meet the growing demands of modern users.

Revolutionizing Cross-Platform App Development: A Deep Dive into .NET MAUI and .NET 8

No Comments »

In a landmark moment for the world of cross-platform app development, the highly anticipated release of .NET MAUI in .NET 8 has emerged as a game-changer, poised to revolutionize the way applications are built and deployed across diverse platforms. Designed to empower .NET developers with unparalleled flexibility and efficiency, .NET MAUI offers a comprehensive solution for crafting cross-platform applications for Android, iOS, macOS, and Windows. With its seamless integration of native functionalities, platform-specific user interfaces, and innovative hybrid experiences, .NET MAUI stands at the forefront of a new era in application development.

The release of .NET 8 represents a significant milestone in the evolution of .NET MAUI, marked by a series of groundbreaking advancements and quality enhancements. Noteworthy achievements include:

  • A staggering 1618 pull requests merged, reflecting a collaborative effort of unprecedented scale and scope.
  • Resolution of 689 bug issues, indicative of a relentless commitment to refining and enhancing the framework’s stability and performance.

These achievements underscore the dedication and ingenuity of the development community, with contributions from diverse teams at Microsoft and the broader community shaping .NET MAUI into a robust and versatile framework that meets the evolving needs of developers worldwide.

A Focus on User Experience: Key Areas of Improvement

In response to invaluable user feedback, .NET MAUI has prioritized key areas for improvement, including:

  • Optimization of keyboard behavior to ensure seamless user interaction across different devices and platforms.
  • Enhanced support for right-to-left languages, catering to a global audience and facilitating localization efforts.
  • Improvements in layout fidelity and performance, guaranteeing a consistent and responsive user experience across various screen sizes and resolutions.
  • Streamlined scroll performance for smoother navigation and enhanced usability.
  • Advanced memory management techniques to optimize resource utilization and enhance overall application performance.

These refinements aim to elevate the development experience and empower developers to create engaging and immersive cross-platform applications that resonate with users worldwide.

Exploring the Latest Innovations in .NET MAUI

Keyboard Accelerators: Empowering Productivity

The introduction of keyboard accelerators enables developers to associate shortcuts with menu items in desktop applications, thereby enhancing productivity and streamlining user interactions. This feature empowers users to perform tasks more efficiently, leveraging keyboard commands for swift execution.

Enhancing Interactivity

.NET MAUI introduces enhancements to PointerGesture, allowing developers to leverage PointerPressed and PointerReleased events for more precise interaction tracking. These enhancements foster greater user engagement and responsiveness across multiple platforms, creating a more immersive and intuitive user experience.

Customizing User Experience

Enhancements to drag and drop gestures provide developers with greater control and flexibility in customizing the user experience. With features such as custom glyphs, captions, and drop actions, .NET MAUI empowers developers to create intuitive and immersive applications that cater to the unique needs and preferences of their users.

Performance and Memory Improvements

.NET 8 introduces significant improvements in performance, app size, and memory management, enabling developers to create smoother and more efficient applications. New features such as AndroidStripILAfterAOT, AndroidEnableMarshalMethods, and NativeAOT for iOS optimize application performance and resource utilization, ensuring a superior user experience.

Enriching the Development Experience

From enhanced WebView capabilities to improvements in TapGestureRecognizer and Blazer WebView, .NET 8 introduces a myriad of new features and enhancements that enrich the development experience. These updates empower developers to create high-quality cross-platform applications with ease, fostering creativity and innovation in the development process.

Community Contributions and Support

One of the hallmarks of the .NET MAUI project is the vibrant and inclusive community that actively participates in its development and evolution. With a total of 94 contributors, including teams from Microsoft and dedicated community members, the collaborative effort behind .NET MAUI underscores the collective passion and commitment to driving innovation in cross-platform app development.

The diverse perspectives and expertise brought forth by community contributors have played a pivotal role in shaping the direction and feature set of .NET MAUI. Through open communication channels, forums, and collaborative platforms, developers from all backgrounds have the opportunity to contribute code, provide feedback, and share insights, fostering an environment of continuous improvement and shared learning.

Embracing The Future

As .NET MAUI and .NET 8 continue to evolve and mature, the future of cross-platform app development looks brighter than ever before. With ongoing advancements, feature enhancements, and community-driven initiatives, .NET MAUI is poised to remain at the forefront of innovation, empowering developers to create next-generation applications that transcend boundaries and redefine user experiences.

By embracing collaboration, innovation, and continuous learning, developers can unlock the full potential of .NET MAUI and .NET 8, paving the way for a future where cross-platform app development knows no limits.

Getting Started

Developers can access .NET MAUI and .NET 8 through the latest stable release of Visual Studio 2022 17.8 or utilize Visual Studio Code with the .NET MAUI extension for a versatile development environment.

  dotnet workload install maui 

The .NET 8 installer and command-line tools simplify installation and setup, enabling developers to hit the ground running with .NET MAUI and embark on their journey towards creating innovative cross-platform applications.

Conclusion

In conclusion, the release of .NET MAUI in .NET 8 heralds a new era of possibilities for cross-platform app development. With its robust framework, powerful features, and vibrant community, .NET MAUI empowers developers to create immersive, feature-rich applications that delight users across diverse platforms.

As developers embark on their journey with .NET MAUI and .NET 8, they are poised to redefine the way applications are built, deployed, and experienced in the digital age. By embracing collaboration, innovation, and creativity, developers can unlock endless opportunities and shape the future of cross-platform app development for generations to come.

Together, let us embrace the future and embark on a journey of exploration, discovery, and innovation with .NET MAUI and .NET 8. The possibilities are limitless, and the future is ours to create.

Elevating Debugging Experience in .NET 8: A Deep Dive into Enhancements

No Comments »

In the ever-evolving landscape of web development, the debugging experience holds a paramount position for developers utilizing the .NET framework. With the advent of .NET 8, our commitment to refining and enhancing the debugging capabilities of frequently used types in .NET applications has taken center stage. This article provides a detailed exploration of the improvements made across crucial components, ushering in a new era of debugging proficiency.

A Closer Look at Debugging Enhancements

Improved Handling of HttpContext and Friends

For developers immersed in ASP.NET Core web app development, HttpContext, HttpRequest, and HttpResponse play pivotal roles. Viewing request and response values, such as headers, cookies, query strings, and form data, is considerably simpler. HttpRequest and HttpResponse now provide a user-friendly overview of the type. Essential information, such as the HTTP request URL or HTTP response status code, is immediately visible. This ensures a more intuitive debugging experience, allowing developers to effortlessly inspect headers, cookies, query strings, and form data. Notably, HttpRequest and HttpResponse now present concise and user-friendly summaries, displaying vital information such as the HTTP request URL and response status code.

.NET 7:

.NET 8:

WebApplication: Elevating Configuration Visibility

WebApplication, serving as the default configuration method for ASP.NET Core apps in Program.cs, has undergone significant updates in .NET 8. This includes the display of crucial information such as configured endpoints, middleware, and IConfiguration values directly within your IDE’s debugger. Similar refinements have been extended to the .NET Generic Host, enriching the debugging experience for apps without HTTP endpoints.

.NET 7:

.NET 8:

MVC and Razor Pages: Streamlined Debugging for Frameworks

The widely embraced ASP.NET Core MVC and Razor Pages frameworks have not been left untouched. In .NET 8, controllers, views, and Razor Pages have received targeted debugging enhancements. The focus has been on decluttering types and optimizing them for improved usability, resulting in a cleaner and more efficient debugging experience.

.NET 7:

.NET 8:

gRPC: Simplifying Client-Side Debugging

For developers leveraging gRPC, a high-performance RPC service library, .NET 8 brings simplifications to debugging client-side calls. The latest version of gRPC now includes comprehensive information about method, status, response headers, and trailers. Developers can benefit from a more insightful debugging experience, particularly when dealing with unary calls.

grpc-dotnet 2.55.0:

grpc-dotnet 2.56.0:

Endpoint Metadata: Enhancing Understanding of Endpoints

Endpoints are at the core of ASP.NET Core, representing executable request-handling code. Debugging Endpoint.Metadata has been enhanced in .NET 8, with the addition of debug text to common metadata. This improvement makes it easier to comprehend configured metadata and understand how requests are matched to endpoints.

.NET 7:

.NET 8:

Logging: Transforming ILogger for Debugging

Logging, powered by Microsoft.Extensions.Logging, is a cornerstone for .NET apps. In .NET 8, ILogger instances have undergone a transformation to be more debug-friendly. Displaying a user-friendly list of information, including name, log level, enablement status, and configured logging providers, ILogger now provides a more accessible debugging experience.

.NET 7:

.NET 8:

Configuration: Simplifying Configuration Understanding

Understanding an app’s configuration values has historically been challenging. In .NET 8, debugging Microsoft.Extensions.Configuration now presents a straightforward list of all configuration keys and values. With precedence already calculated, developers can easily grasp the configuration values that the app will use.

.NET 7:

.NET 8:

And More Across-the-Board Improvements

While the aforementioned improvements highlight key areas, .NET 8 brings a plethora of debugging enhancements across various components. From Dependency Injection to ClaimsPrincipal and ClaimsIdentity, StringValues and StringSegment, HostString, PathString, QueryString, FragmentString, HTTP header collections, to ASP.NET Core MVC’s ModelState, these improvements collectively contribute to a more refined debugging experience.

A Deeper Dive into Key Components

Dependency Injection

Dependency Injection (DI) plays a crucial role in modern software development, promoting code maintainability and scalability. In .NET 8, debugging enhancements have been introduced to streamline the visualization of DI, ensuring a clearer understanding of dependencies and their resolutions during debugging sessions.

ClaimsPrincipal and ClaimsIdentity

Authentication and authorization are fundamental aspects of web applications, and ClaimsPrincipal and ClaimsIdentity are central to managing user identities and access control. In .NET 8, debugging improvements in these components provide a more transparent view of claims, facilitating a smoother debugging experience for identity-related issues.

StringValues and StringSegment

Handling strings efficiently is paramount in any application. In .NET 8, improvements to StringValues and StringSegment aim to simplify string-related debugging challenges. Developers can now expect a more intuitive representation of string values during debugging, aiding in quicker issue identification and resolution.

HostString, PathString, QueryString, and FragmentString

In web development, understanding and manipulating URL components is crucial. .NET 8 introduces debugging enhancements to HostString, PathString, QueryString, and FragmentString, offering a clearer representation of URL-related data during debugging sessions. This facilitates a more straightforward identification of issues related to URL handling in applications.

HTTP Header Collections

HTTP headers play a vital role in web communication, and debugging issues related to header handling is common. In .NET 8, debugging improvements to HTTP header collections provide developers with enhanced visibility into requests, allowing for a more precise diagnosis of problems associated with headers during debugging sessions.

RouteValueDictionary

Routing is a critical component in web applications, and RouteValueDictionary is instrumental in handling route-related data. .NET 8 introduces debugging enhancements to RouteValueDictionary, offering augmented visibility into routing data during debugging. This facilitates a more insightful debugging experience when dealing with route-related issues.

ASP.NET Core MVC’s ModelState

In the world of ASP.NET Core MVC, ModelState is essential for handling and validating data models. Debugging ModelState has been streamlined in .NET 8, providing developers with a more organized and comprehensive view of model state information during debugging sessions. This ensures a more efficient debugging process when addressing model state-related issues.

Try It Now

Excited to experience these debugging enhancements in action? They are available in .NET 8 RC1, ready for exploration and feedback. To embark on this journey:

1. Download the latest .NET 8 release.

2. Launch Visual Studio 2022 or your preferred IDE.

3. Create an ASP.NET Core or Worker Service app.

4. Set breakpoints and run the app with debugging (F5).

Updates to ASP.NET Core in .NET 7 Release Candidate 2

No Comments »

On October 11th, 2022, Microsoft released.NET 7 Release Candidate 2. It is supported in production as the last release candidate (RC) for.NET 7.

Visual Studio 17.4 Preview 3 has been used to test.NET 7 Release Candidate 2. If you want to test out.NET 7 with products from the Visual Studio family, we advise using the preview channel builds. We advise using the most recent Visual Studio 2022 for Mac preview if you use macOS.

We want to highlight the key concepts of .NET 7 in this post and give you resources to delve further into the specifics. For a more thorough list of each enhancement and feature added to .NET 7 Release Candidate 2 you can check the previous posts from .NET’s official website.

C# 11

The most recent version of C#, C# 11, is now accessible in.NET 7.

They openly create and develop C#. To view the most recent C# feature requests and meeting notes, connect to them on the CSharpLang repository. As soon as work is scheduled, you can check the Feature Status page to see how things are going. Create a C# project and set the LangVersion property to Preview to experiment with the C# 11 preview features.

Libraries & SDK

The.NET libraries are always getting better. New APIs with completely new features are frequently added. Existing APIs are receiving performance upgrades, which will benefit you if you simply upgrade. New libraries are being created to help you with your daily tasks. Every new version of.NET brings a wealth of enhancements to the.NET SDK, which contains the essential tools for designing, developing, and maintaining.NET projects. Numerous improvements were already present in earlier preview. To read more about new SDK features, see the following:

Re-enable Reflection Fallback For System.Text.Json source generation

.NET 7 introduced an intentional breaking change which removes silent fallback to reflection-based serialization in System. generators for Text.Json sources. Early customer feedback indicates that a significant number of users have (mostly unintentionally) come to depend on the fallback behavior.

Despite the fact that a workaround for the breaking change has been documented, it still calls for a code change, which may not always be possible. Starting with.NET 7 RC 2, you can use the provided AppContext compatibility switch to globally re-enable reflection fallback. To enable reflection fallback once more for all source-generated contexts in your app, add the following entry to the project file for your application:

<ItemGroup>
  <RuntimeHostConfigurationOption Include="System.Text.Json.Serialization.EnableSourceGenReflectionFallback" Value="true" />
</ItemGroup>

See the post on .NET runtime configuration settings for more details on using AppContext switches.

Implementation of Generic Math interfaces correctly

The.NET runtime ensures that user code correctly implements the.NET Generic Math interfaces that use the Curiously Recurring Template Pattern (CRTP). It specifically issues a warning if a type that implements the CRTP pattern and the.NET Generic Math interfaces fails to fill the generic type parameter with the type itself.

For example:

public readonly struct DateOnly : IParsable<DateOnly> // correct implementation of IParsable<TSelf> interface
{ ... }
public readonly struct MyDate : IParsable<DateOnly> // Warns: "The 'IParsable<TSelf>' requires the 'TSelf' type parameter to be filled with the derived type 'MyDate' " the type parameter TSelf
{ ... }

Some built in operators added in .NET 7 for System. System and IntPtr. In.NET 6 and earlier, UIntPtr behave differently from user-defined operators. Some operators that used to throw when the context was unchecked while overflowing are now only allowed to do so when wrapped in checked context, and some operators that did not previously throw in checked context are now only allowed to throw when the context is unchecked. The analyzer alerts it when it finds the code that might be responsible for those behavioral changes.

For example:

checked
{
    intPtr2 = intPtr1 + 2; // Warns: "Starting with .NET 7 the operator '+' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."

    intPtr2 = intPtr1 - 2; // Warns: "Starting with .NET 7 the operator '-' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."

    void* ptr = (void*)intPtr1; // Warns: "Starting with .NET 7 the explicit conversion '(void*)IntPtr' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."

    intPtr2 = (IntPtr)ptr; // Warns: "Starting with .NET 7 the explicit conversion '(IntPtr)void*' will throw when overflowing in a checked context. Wrap the expression with an 'unchecked' statement to restore the .NET 6 behavior."
}

intPtr1 = (IntPtr)longValue; // Warns: "Starting with .NET 7 the explicit conversion '(IntPtr)Int64' will not throw when overflowing in an unchecked context. Wrap the expression with a 'checked' statement to restore the .NET 6 behavior."

int a = (int)intPtr1; // Warns: "Starting with .NET 7 the explicit conversion '(Int32)IntPtr' will not throw when overflowing in an unchecked context. Wrap the expression with a 'checked' statement to restore the .NET 6 behavior."

Support

The release of.NET 7 is covered by Standard Support. There is no change to the support duration despite the fact that this is the new name for what was previously known as Current. The Standard Support period for.NET releases with odd numbers is 18 months. The 36-month length of Long-Term Support (LTS), as well as its name, have not changed. For more information, see our.NET and.NET Core Support Lifecycle document.

Wrapping Up

.NET is loved for it’s simplicity of C# cause everything can be completed quickly and easily (in C#, everyone who can program can program). Similarly, the Jit itself is intuitive in the way it applies compiler techniques. Finally, a shoutout to SuperPMI.

Releases of .NET include products, libraries, runtime, and tooling, and represent a collaboration across multiple teams inside and outside Microsoft. Give .NET 7 Release Candidate 2 a try and tell us what you think!

Getting Started With .NET MAUI

No Comments »

MAUI has officially been released! With C# & XAML, we can now construct Native Mobile and Desktop applications. Yes, now we can create native Android, iOS, macOS, and Windows applications from a single code base. This is possible by using .NET’s new feature called Multi-platform App UI (MAUI). This is a cross-platform framework called .NET MAUI. MAUI, which stands for Multiple-Platform Application UI, allows us to create applications from a same code base for Android, iOS, Windows, and macOS. In addition, this implies that we can export apps to several platforms from a single project.

What is MAUI?

Multi-Platform App UI, or MAUI, is a free and open-source cross-platform framework. We can create native Android, iOS, macOS, Mac Catalyst, Tizen, and Windows applications using MAUI by using a single code base for all of these platforms.

The successor to Xamarin is the open-source .NET MAUI. Forms with UI controls rebuilt from the ground up for performance and extensibility, extending from mobile to desktop scenarios. You’ll see many similarities between .NET MAUI and Xamarin.Forms if you’ve previously used those tools to create cross-platform user interfaces. There are some differences, though. If necessary, you can add platform-specific source code and resources when developing multi-platform apps with.NET MAUI. The ability to implement as much of your app logic and UI layout in a single code base is one of the main goals of.NET MAUI.

The development of Xamarin.Forms from mobile to desktop applications led to MAUI. If you have experience with Xamarin.Forms, you will have no trouble understanding.NET MAUI.

The .NET MAUI is for such

  • Developers who want to create cross-platform applications using C# and XAML from a single code base.
  • Sharing the same UI layouts and designs across platforms, which reduces the time needed for design implementation.
  • To use the same business logic, code, and testing across all platforms.

Install Visual Studio 2022 Preview

Only the Visual Studio 2022 Preview offers .NET MAUI right now. Obtain the Visual Studio 2022 Preview by clicking here.

Select .NET Multi-platform App UI Development Workload from the list below once it has been downloaded and installed.

It’s best to restart the computer after a successful installation before starting Visual Studio 2022 Preview.

Making the first.NET MAUI application in the preview of Visual Studio 2022

At first, launch the Visual Studio 2022 Preview and Choose to create a new Project and search for MAUI.

.NET MAUI has three categories, .NET MAUI App, .NET MAUI Blazor App, .NET MAUI Class Library.

In upcoming articles, we’ll examine each category in greater detail. The.NET MAUI App currently allows us to create applications from a single code base for Windows, Android, iOS, Mac Catalyst, MAUI, and Tizen.

.NET MAUI Blazor App – These applications are created using Blazor and can run on iOS, Android, Mac Catalyst, Tizen, and WinUI from a single source of code.

Applications can be run on Android, iOS, Mac Catalyst, macOS, Tizen, and Windows thanks to the .NET MAUI Class Library, which was used in their development.

Let’s create our first .NET MAUI App.

Choose to .NET MAUI App from the Project Template options and click Next.

.NET MAUI

Save it in the location by providing the project name.

.NET MAUI

.NET MAUI App uses XAML and is similar to WPF.

.NET MAUI

.NET MAUI Blazor

Now you may ask what is .NET Blazor?

It’s a feature of ASP.NET, the well-known web development framework, is called Blazor. It adds tools and libraries for creating web apps to the.NET developer platform.

Instead of using JavaScript, Blazor enables you to create interactive web user interfaces. Reusable web UI components are implemented in Blazor apps using C#, HTML, and CSS. Because C# is used for both client and server code, you can share code and libraries.

Using WebAssembly, Blazor can execute your client-side C# code right in the browser. You are able to reuse the code and libraries from the server-side components of your application because real.NET is running on WebAssembly.

You could also have Blazor execute your client logic on the server. Using SignalR, a real-time messaging framework, client UI events are returned to the server. The necessary UI changes are sent to the client and merged into the DOM once execution is finished.

In today’s discussion let’s use blazor to export multiple platforms

Using Blazor, we can easily export applications for Multiple Platforms.

Choose .NET MAUI Blazor from the Project Template while creating a new project and save it.

The default project folder structure is shown in the image below. It will be very simple for you to do this if you are already familiar with Blazor.

Similar options for exporting the application to various platforms are available for this project as they are for the.NET MAUI App. Let’s test the program on various platforms.

This project also has similar options to the .NET MAUI App to export the application to Mac, android or iOS platforms. But we will cover that in another article.

Conclusion

This article covered the creation of .NET MAUI applications and how to debug them across various platforms. The debugging for Windows devices, and procedure to create application in Mac, android and iOS devices have not been covered; they will be in subsequent articles later. But we hope that this article will help you to go through with everything related to MAUI if you are new here. Please feel free to share your feedback with us.

Improve Your Model’s Performance and Accuracy with ML.NET’s New Update

No Comments »

Automated Machine Learning (AutoML) is one of the fascinating subfields of Data Science right now. It sounds fantastic for those who are unfamiliar with machine learning, but it concerns present Data Scientists a lot. The media presentation of AutoML suggests that the technology has the potential to drastically transform the way we produce models by removing the need for Data Scientists. In principle, utilizing AutoML to automate the process entirely is a brilliant idea, but it introduces several opportunities for bias and misunderstanding in practice. Machine learning model training can be a time-consuming process. Automated Machine Learning (AutoML) makes identifying the best strategy for your circumstance and dataset easier.

ML.NET is an open-source, cross-platform machine learning framework for .NET developers that allows custom machine learning to be integrated into .NET applications. Microsoft changed the AutoML implementation in its Model Builder and ML.NET CLI tools based on Microsoft Research’s Neural Network Intelligence (NNI) and Fast and Lightweight AutoML (FLAML) technology last year.

New AutoML Updates

Training machine learning models is a time-consuming and iterative task. Automated Machine Learning (AutoML) automates that process by making it easier to find the best algorithm for your scenario and dataset. AutoML is the backend that powers the training experiences in Model Builder and the ML.NET CLI. Last year we announced updates to the AutoML implementation in our Model Builder and ML.NET CLI tools based Neural Network Intelligence (NNI) and Fast and Lightweight AutoML (FLAML) technologies from Microsoft Research. These updates provided a few benefits and improvements over the previous solution which include:

  • Increase in the number of models explored.
  • Improved time-out error rate.
  • Improved performance metrics (for example, accuracy and R-squared).

The Experiment API

An experiment is a collection of training runs or trials. Each trial produces information about itself such as:

Evaluation metrics: The metrics used to assess the predictive capabilities of a model.

Pipeline: The algorithm and hyperparameters used to train a model.The experiment API includes a set of AutoML defaults, making it easier to add to a training pipeline. The dataPrepPipeline in this code snippet is a sequence of transforms to get the data into the proper format for training. The AutoML components required to train a regression model are added to that pipeline.

The same idea holds for other supported cases, such as categorization. When building an experiment using the training pipeline, one may choose the length of the training, the training and validation sets, and the evaluation measure they are optimizing. After setting up the pipeline and experiment, call the Run function to begin training.

// Configure AutoML pipeline
var experimentPipeline =    
    dataPrepPipeline
        .Append(mlContext.Auto().Regression(labelColumnName: "fare_amount"));

// Configure experiment
var experiment = mlContext.Auto().CreateExperiment()
                   .SetPipeline(experimentPipeline)
                   .SetTrainingTimeInSeconds(50)
                   .SetDataset(trainTestSplit.TrainSet, validateTestSplit.TrainSet)
                   .SetEvaluateMetric(RegressionMetric.RSquared, "fare_amount", "Score");

// Run experiment
var result = await experiment.Run();

In this code snippet, the dataPrepPipeline is the series of transforms to get the data into the right format for training. The AutoML components to train a regression model are appended onto that pipeline. The same concept applies for other supported scenarios like classification.

What’s next for ML.NET?

We’re actively working towards the areas outlined in our roadmap.

Deep Learning

A few months ago we shared our plan for deep learning. A significant portion of that plan revolves around improving ONNX experiences for consumption and enabling new scenarios through TorchSharp, A .NET library that provides access to the library that powers PyTorch. Some of the progress we’ve made towards this plan includes:

Enabled global GPU flags for ONNX inferencing. Prior to this update, when you wanted to use the GPU for inferencing with ONNX models, the FallbackToCpu and GpuDeviceId flags in the ApplyOnnxModel transform were not saved as part of the pipeline. As a result, you had to fit the pipeline every time. We’ve made these flags accessible as part of the MLContext so you can save them as part of your model.

TorchSharp targets .NET Standard. TorchSharp originally targeted .NET 5. As part of our work in enabling TorchSharp integrations into ML.NET, we’ve updated TorchSharp to target .NET Standard.

We’re excited to share with you the progress we’ve made integrating TorchSharp with ML.NET in the coming weeks. Stay tuned for the blog post.

.NET DataFrame

Clean and representative data improves the performance of the model. As a result, data analysis, cleansing, and preparation for training is a crucial stage in the machine learning workflow. A few years back, we introduced the DataFrame type to.NET as a preview in Microsoft.Data.Analysis NuGet package. The DataFrame is still in preview. as it is very important for someone to have the tools to perform data cleaning and processing tasks and have started to organize and prioritize feedback, they address existing stability and developer experience pain points. The feedback is being organized as part of a GitHub issue.

MLOps

Machine Learning Operations (MLOps) is like DevOps for the machine learning lifecycle. This includes things like model deployment & management and data tracking, which help with productionizing machine learning models. We’re constantly evaluating ways to improve this experience with ML.NET.

Recently we published a blog post that guides you through the process of setting up Azure Machine Learning Datasets, training an ML.NET model using the ML.NET CLI and configuring a retraining pipeline with Azure Devops. For more details, check out the post Train an ML.NET model in Azure ML.

Conclusion

Machine Learning Operations (MLOps) is a machine learning lifecycle equivalent to DevOps. It comprises features such as model deployment and administration and data tracking, which aids in producing machine learning models. Microsoft continually strives for ways to improve the ML .NET experience. These are some updates brought in by Microsoft ib their ML .NET framework, which will help developers better their workflow.

Some of The Best Tools You Can Use as A .NET Developer

No Comments »

The .NET framework is one of the most popular open-source frameworks that is used by millions of software developers. According to the latest estimates, there are over 6 million .NET engineers worldwide. This has spurred the growth of various third-party development tools. To get a first-hand opinion on the most valuable and useful developer tools out there. Today, we presented a compiled list of essential .NET developer tools. Let’s have a look at the 10+ most valuable tools every .NET developer should use.

Best Tools for .NET Developers

Visual Studio Gallery

This is an essential tool that offers quick access to Visual Studio extensions, controls, and templates. The marketplace integrates with the IDE, allowing you to access over 7,000 products currently available. The Visual Studio Gallery is critical in how you locate the right extension for your needs. Without the VS Gallery, clicking on Extensions in VS wouldn’t work.

GitHub Extension for Visual Studio

With version control being so popular, Microsoft couldn’t ignore GitHub by NOT including it within Visual Studio. For developers, GitHub is vital. This extension helps us to connect our IDE directly to our GitHub repositories. This means that one can create, clone, and publish your projects, and create or view pull requests right within Visual Studio.

ReSharper

A developer who wants to become more productive when writing C# code should run, not walk, to purchase this tool. This is a Visual Studio extension by JetBrains. ReSharper adds the power to analyze code quality, then to find and fix the errors quickly. It also has several shortcuts for quick and easy refactoring and navigation.

NDepend

NDepend is also a Visual Studio extension for static code analysis. For optimizing and refactoring code at a high level, NDepend is one of the best. It essentially allows developers to see the “wood for the trees”, giving a wide view of your application and how is your code organized. The tool helps us measure our code quality using various metrics, to visualize its design, and to accurately estimate your technical depth, right within the IDE.

NuGet

NuGet is a package manager for .NET that allows you to access various third-party libraries, or to create and share your tools. With over 98 thousand packages currently available, it is the largest database of third-party components for .NET. NuGet streamlines the delivery of third-party components directly into your Visual Studio project at design time and contains a command line for CI/CD automated deploys.

Web Essentials for Visual Studio

This Visual Studio extension augments the core VS functionality with more powerful and useful features, including task shortcuts and improved Intellisense for CSS/HTML/JavaScript, etc. This is a handy tool for web developers using Visual Studio that can be a real productivity booster. In this one extension, you receive custom editors, a Browser Link to immediately see changes in the browser, TypeScript, Less, Markdown, and CoffeeScript support.

Novi Builder

Novi Builder is a visual HTML editor that allows changing texts, images, links, backgrounds, and other elements effortlessly. There are 200+ useful elements that make it possible to create different pages. Novi also provides a code editor to work with HTML, CSS, and JS code for your online projects.

.NET Reflector

.NET Reflector is a decompiler and static analyzer for the .NET framework. It helps you understand and debug your .NET code, including third-party components, even if you don’t have any documentation or comments. It also gives us a solid insight into what an assembly contains and what code is actually doing when decompiled.

SQLComplete

SQLComplete is a productivity tool that augments the SQL Server Management Studio with several useful features, including tab coloring, script generation, navigation, and more. Full-stack developers always get their hands dirty with SQL. This freemium tool is the equivalent of Intellisense in C# and plugs into SQL Server Query Analyzer and Visual Studio. Along with its exceptional Intellisense capabilities, it also has a handful of features to assist with snippets, templating, and SQL formatting.

LINQPAD

This is a safe playground where you can test your LINQ queries or any C#/F#/Visual Basic program. The tool has a built-in debugger and autocomplete features, and is a perfect platform for prototyping with instant feedback. LIt is simply a Notepad for LINQ and also an essential tool for experimenting with LINQ and testing code snippets before they are introduced into code.

ELMAH

ELMAH stands for Error Logging Modules and Handlers. It is an open-source debugging and error logging tool for ASP.NET, and is provided by Google. It really stands in comparison to some other paid .NET logging solutions that you can find online.

Microsoft Web Platform Installer

This free package management software makes it easy to access the latest components of the Microsoft Web Platform, including IIS, SQL Server Express, .NET Framework, Visual Web Developer, and much more. The system keeps you up to date by automatically installing the latest versions of each component.

Conclusion

The choice of .Net tool varies greatly on the specific task or situation. Using additional instruments can free you from routine tasks and automate many processes, thus optimizing your performance and eliminating errors. Some of them have some similar as well as some unique features that can be very helpful on a specific situation.

Follow C# 411 on Twitter

No Comments »

Tired of RSS feeds?  Now you can follow C# 411 on Twitter!

C# 411 on Twitter

Cool Twitter logo from here

Visual Studio 2010 and .NET 4.0 Beta 2

No Comments »

The second beta version of Visual Studio 2010 and Microsoft .NET Framework v4.0 are now available.  VS 2010 and .NET 4.0 deliver significant new capabilities and improvements.  The Beta 2 release was focused on performance, stability, and the integration of the overall feature set.  The development team is awaiting our feedback on the product and preparing for the final release candidate (RC).  Beta 2 includes a “go-live” license, which means you can start using these tools for your production projects.

VS 2010 and .NET 4.0 are slated to be released on March 22, 2010.

Download VS 2010 and .NET 4.0 Beta 2
More details about Beta 2 from Scott Gu

.NET News

No Comments »

Two social networking news sites have emerged for .NET developers: DotNetKicks and the new .NET Shoutout.  Both sites provide tons of .NET news and information, if you’re willing to spend the time to dig through it all.  But for busy developers, there is a new .NET news site that cuts through all the clutter.  

Dot-Net-News.com provides the latest news and information about the Microsoft .NET development environment including C#, Visual Basic and Visual Studio.  No fluff, no spam, just the facts, man.

Here are some of the latest .NET news stories:

Subscribe to the feed today to get your steady-stream of .NET news!

keep looking »