Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
158834 stories
·
33 followers

AI UX Patterns for User Clarity

1 Share

These patterns can help provide insight into what our AI is doing, inviting users to engage because they’re clear on what’s happening.

Hand-in-hand with trust comes clarity. Clarity is one of the most important aspects of creating a good user experience, generally—and the stakes only get higher when we start incorporating AI.

Because so much of AI still feels like an unknown our users, we need to be as descriptive and straightforward as possible about what’s happening at any given time. The more insights we can give them about what our software is doing and what they can expect to happen next, the more comfortable they will feel engaging with our AI features.

I’ve noticed that there can be a kind of impulse to position AI to users as “magic,” not only in marketing but also within the software, itself. We don’t have to look any further than the prevalence of the AI sparkle icon to see example of that. However, while that might feel mysterious and cool, it’s not accurate.

Our users deserve clarity over dramatics. They want to know what’s going on and how a given output was created, and there’s no reason for us not to pull back that curtain wherever we can.

UX Pattern: Live Generation

One of the most obvious ways for us to do this is with streaming text or similar live generation of content. Not only is this is a great way to disguise the latency issue of AI generation (after all, nobody likes to watch a loading spinner), but it’s also a fantastic way to show the user what’s happening in real time.

If we make the user wait until an entire response is generated, there’s a non-zero chance that it won’t actually be what they wanted. However, if we start showing a partial response as it’s being generated, we give our users the chance to start assessing it immediately. That means they can start coming up with followup questions, adjustments or simply stopping the process entirely if it’s not returning what they expected.

This also engages the user as an active participant in the process, helping to prevent the XKCD “code compiling” experience of pressing a button and then walking away. You’ve probably experienced how much harder it is to complete a task if you’re constantly disengaging from the workflow. Even if you know that a process only takes a minute, if there’s not something to keep you there, you’ll start checking your emails, replying to Slack messages, scrolling social media … and just like that, a one-minute wait becomes a 10-minute detour, making it much harder to pick up where you left off. The more we can prevent this for our users, the more productive they can be with our tools.

UX Pattern: Thinking Aloud

Another thing that can help remove the wall between the AI and the user is having it “think out loud” as it processes a request. Similarly to live streaming, this also improves a user’s confidence level in the output because they’re able to kind of follow the breadcrumbs and have a deeper understanding of how a given conclusion was reached.

After all, we do this all the time when talking to other people! If we’re presenting an idea, we know that it’s helpful for us to talk through the rationale behind how we got there and why we think it’s the right choice. Explaining ourselves is a very natural part of human interaction that we’ve come to expect, and when we don’t see that mirrored in the systems we use it can feel frustrating—like something is being intentionally hidden from us.

Additionally, seeing the chain of thought process allows for better, more accurate revisions when the output wasn’t what they expected. If the user can understand all the steps that happened between points A and F, they can pinpoint where things went off the rails, allowing them to give more specific instructions or clarify ambiguous requests.

UX Pattern: Highlight Changes

Some patterns are easy to adjust from their previous non-AI usage into this context. Highlighting new content is one of those: it’s not groundbreaking, but when combined with everything else, it’s immensely helpful in helping users keep track of AI actions—especially when an agent is acting autonomously.

The basic idea is that when new content appears or something is updated, it gets specially marked for the user to draw their attention to it.

Sometimes that might mean literally moving their focus up or down the page to see what’s changed—like when new messages appear in an ongoing chat and the message history automatically scrolls down to display it.

But other times, it can just mean drawing the user’s eye back to a space they might not have been actively watching, even if that doesn’t include any literal movement on the page—like changing the color of revised text, putting a box or highlight around new material, or marking lines of code that are different.

Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

Build React, Angular, and Vue Applications Faster with Syncfusion CLI

1 Share

Build React, Angular, and Vue Applications Faster with Syncfusion CLI

TL;DR: Syncfusion CLI simplifies frontend development by automating project creation, component integration, theme management, and AI-assisted workflows for React, Angular, and Vue applications. Learn how to scaffold projects faster, maintain consistency across teams, and streamline development tasks from a single command-line tool.

Setting up a new web application is often more time-consuming than it should be. Before writing a single business feature, developers typically spend time creating the project structure, configuring frameworks, installing dependencies, selecting themes, and integrating UI components.

To streamline this process, we’ve introduced Syncfusion® CLI, a command-line tool that helps developers create, configure, and manage applications built with Syncfusion components. Whether you’re starting a new React, Angular, or Vue application, adding components to an existing project, or setting up AI-assisted development workflows, Syncfusion CLI helps reduce setup effort and gets you to development faster.

Why Syncfusion CLI?

Modern frontend projects often require repetitive setup tasks that must be performed every time a new application is created. While these tasks are necessary, they can slow development and create inconsistencies across projects.

Syncfusion CLI provides a unified workflow for common development tasks, helping teams:

  • Create React, Angular, and Vue applications quickly.
  • Start with preconfigured Syncfusion component templates.
  • Apply consistent themes across projects.
  • Add Syncfusion components to existing applications.
  • Configure Syncfusion MCP support for AI-powered workflows.
  • Install Syncfusion Skills for AI-assisted development.
  • View project and environment information directly from the command line.

Instead of manually performing multiple setup steps, developers can manage everything through a single tool.

Installing Syncfusion CLI

You can install the Syncfusion CLI globally using npm:

npm install -g @syncfusion/syncfusion-cli

Once installation is complete, run the following command to verify that the CLI is available:

sf

This launches the interactive experience and provides access to the available commands.

How to use Syncfusion CLI

Syncfusion CLI supports both guided and command-driven workflows, allowing developers to choose the approach that best fits their development style.

Interactive mode

The interactive mode is ideal for developers who are new to Syncfusion CLI or prefer a guided experience.

Run:

sf

You’ll be presented with a terminal-based menu that walks you through common tasks such as:

  • Creating a new project
  • Adding components
  • Switching themes
  • Configuring MCP
  • Installing Skills
  • Viewing project information

This approach eliminates the need to memorize commands and simplifies initial project setup.

Non-interactive mode

For automation scenarios and repeatable workflows, developers can provide all configuration options directly from the command line.

For example:

sf new my-vue-app --framework vue --type ts --template scheduler --theme tailwind3 --styling scss

This command creates a Vue TypeScript application using the Scheduler template, Tailwind 3 theme, and SCSS styling.

Because all options are explicitly defined, this workflow is especially useful for build pipelines, team standards, and CI/CD environments.

Create applications with templates and themes

One of the primary benefits of Syncfusion CLI is the ability to generate a fully configured application in a single command.

Example: Create a React Application

sf new my-react-app --framework react --type ts --template grid --theme material3

This command creates a React TypeScript application with the Syncfusion Grid component and Material 3 theme already configured.

After setup, you can run the project to view the generated application workspace and the ready-to-use Grid component, as shown below.

React application workspace created with Syncfusion
React application workspace created with Syncfusion CLI
Syncfusion Grid component generated from the selected template
Syncfusion Grid component generated from the selected template

Ready-to-Use Project Templates

Developers can choose from several built-in templates when creating a project:

  • Empty
  • Grid
  • Chart
  • Scheduler
  • Gantt
  • Diagram
  • Rich Text Editor
  • PDF Viewer
  • DOCX Editor
  • Spreadsheet Editor
  • File Manager

These templates eliminate manual setup and allow developers to start with working implementations of commonly used Syncfusion components.

Built-in theme support

Syncfusion CLI includes support for popular themes:

  • Material 3
  • Tailwind 3
  • Fluent 2
  • Bootstrap 5.3

If you need to update an existing application’s appearance, switch themes using:

sf theme switch tailwind3

This helps teams maintain a consistent design system without extensive manual configuration.

Add components to existing projects

Syncfusion CLI is not limited to new applications. You can also enhance existing projects by adding Syncfusion components as needed.

Examples:

sf add grid
sf add chart
sf add scheduler
sf add gantt
sf add diagram
sf add rich-text-editor
sf add file-manager
sf add pdf-viewer
sf add docx-editor
sf add spreadsheet-editor

This approach simplifies component integration and reduces the amount of setup typically required when introducing new functionality.

AI-assisted development with MCP and Skills

As AI becomes an increasingly important part of modern development workflows, Syncfusion CLI provides tools to help teams integrate AI-assisted experiences into their projects.

Configure Syncfusion MCP

To configure the Syncfusion MCP server for a supported editor:

sf mcp init vs-code

This command sets up the required environment for AI-enabled development scenarios.

Install Syncfusion Skills

To install Syncfusion Skills in an existing project:

sf skills install

These skills help AI assistants better understand and work with Syncfusion components, making it easier to generate, modify, and maintain application code.

Show project information

sf info

Example Workflows

Workflow Command
Create a React Vite Grid application sf new my-react-app --framework react --build-tool vite --type ts --template grid --theme material3 --styling css
Create a React Next.js Chart application sf new my-next-app --framework react --build-tool nextjs --type ts --template chart --theme fluent2 --styling scss
Create an Angular Scheduler application sf new my-angular-app --framework angular --type ts --template scheduler --theme bootstrap5.3 --styling css
Create a Vue Chart application sf new my-vue-app --framework vue --type ts --template chart --theme tailwind3 --styling scss

Note: The --build-tool option is supported only for React projects.

These examples illustrate how Syncfusion CLI can simplify common development tasks across React, Angular, and Vue projects.

Who can benefit from Syncfusion CLI?

Syncfusion CLI is designed for a wide range of development scenarios, including:

  • Frontend developers who want to build applications quickly.
  • Teams looking to standardize project setup across multiple applications.
  • Developers working with React, Angular, or Vue.
  • Organizations that rely on automation and CI/CD workflows.
  • Teams adopting AI-assisted development and MCP-based tooling.

Whether you’re building a prototype, creating a production application, or managing multiple projects across a team, Syncfusion CLI helps simplify project setup and ongoing maintenance.

Frequently Asked Questions

Do I need prior experience with Syncfusion components to use Syncfusion CLI?

No. Syncfusion CLI is designed to simplify the setup process for both new and experienced users. Developers can use the interactive mode to discover available options and create projects without needing in-depth knowledge of individual components or project configurations.

Can Syncfusion CLI be used in team development environments?

Yes. Syncfusion CLI helps teams follow consistent project structures, themes, and component configurations across multiple applications. This can reduce onboarding time and minimize differences between development environments.

Is Syncfusion CLI suitable for rapid prototyping?

Absolutely. By generating preconfigured applications and component-based templates, Syncfusion CLI allows developers to quickly create working prototypes and proof-of-concept applications, helping teams validate ideas faster.

Can I customize the generated application after it is created?

Yes. Applications generated by Syncfusion CLI are standard React, Angular, or Vue projects. Once the project is created, you can freely modify the structure, add third-party packages, customize components, and adapt the application to your specific business requirements.

Conclusion

Syncfusion CLI brings project creation, component integration, theme management, MCP configuration, Skills installation, and project utilities together in a single developer-friendly tool.

Instead of spending valuable time on repetitive setup tasks, developers can quickly create applications, integrate components, standardize project configuration, and enable AI-assisted workflows through a consistent command-line experience.

Whether you prefer a guided, interactive workflow or a fully automated setup process, Syncfusion CLI provides a faster, more efficient way to build React, Angular, or Vue applications with Syncfusion components.

Start using Syncfusion CLI today and accelerate the way you build modern web applications.

Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

Introducing Project Manager in Code Studio: Structured AI Development

1 Share

Introducing Project Manager in Code Studio: Structured AI Development

TL;DR: Have you ever looked back at AI-generated code and wondered why a particular decision was made? While AI can generate code quickly, specifications, reviews, and implementation context are often lost in the process. Project Manager in Syncfusion Code Studio brings structure to AI-assisted development with a Define → Plan → Build → Verify → Review process that keeps requirements, decisions, and validation steps connected to every task. The result is faster delivery, fewer missed steps, and software that’s easier to maintain long after it’s shipped.

Deadline pressure is familiar territory for most developers. You open an AI coding agent, describe a feature, and within minutes there’s code working on your screen. A quick review, a merge, and you’re on to the next task.

The trouble usually starts later.

A few weeks after deployment, a bug appears in production. Someone asks why an authentication flow changed or why a particular implementation decision was made. The code exists, but the context doesn’t. There is no specification, no review history, and no record of the reasoning behind the change.

The problem isn’t AI—it did exactly what it was asked to do.

The real issue is that many AI coding processes focus on generating code while overlooking the practices that help teams deliver reliable software—requirements, planning, verification, security reviews, and decision tracking.

That’s exactly why we’re introducing Project Manager in Syncfusion® Code Studio. Instead of treating AI-assisted development as a simple prompt-to-code experience, the newly introduced Project Manager brings a structured software delivery process directly into your coding session, helping teams maintain engineering discipline without adding manual overhead.

What teams lose when AI coding skips the process

Most developers using AI coding tools eventually run into the same challenges:

  • No specification, no shared understanding: The feature works, but the reasoning behind it disappears. A week or a month later, developers are left reverse-engineering requirements from the code itself.
  • Security reviews become “Something we’ll do later”: Authentication changes, API integrations, and user input handling often move forward without formal review, not because teams don’t care, but because nothing in the process requires it.
  • Fast code doesn’t eliminate the need for review: AI can generate code quickly, but it cannot guarantee every architectural decision, edge case, or performance concern has been considered. Without review, technical debt accumulates quietly.
  • Constant tool switching breaks focus: Specifications live in one tool, tasks in another, reviews elsewhere, and test results somewhere else entirely. Context gets fragmented, and important details get lost.

These aren’t edge cases. They’re common outcomes when AI-assisted development lacks structure.

Project Manager in Code Studio: Bringing SDLC structure into AI-assisted development

Most teams already understand the value of specifications, planning, testing, and reviews. The challenge is keeping those activities consistent when deadlines are tight.

Project Manager addresses this by making the development process part of the coding experience itself.

Instead of moving directly from prompt to code, work progresses through a structured sequence:

Define → Plan → Build → Verify → Review

Every stage creates a record of what was agreed upon, what was built, and how it was validated. The goal isn’t to introduce more processes; it’s to ensure critical steps are no longer easy to skip.

Working architecture of Project Manager in Code Studio
Working architecture of Project Manager in Code Studio

Why not just use any AI tool that generates plans or reviews?

Many AI coding tools can generate plans, specifications, or code reviews when asked. The challenge isn’t creating those artifacts; it’s preserving them after the conversation ends.

A month later, the code may still be there, but the reasoning, approvals, and validation history are often difficult to find.

Project Manager takes a different approach. Every artifact—the specification, implementation plan, verification report, and code review—is saved directly to the repository and linked to the task that produced it. That means the context stays with the project, making changes easier to understand, review, and maintain over time.

Traditional AI vs. Project Manager

Most AI coding tools take you from prompt to code in a single step. The speed is real but so is what can get lost along the way. Here’s how the two approaches compare:

Area Traditional AI Project Manager
Process Prompt → Code Prompt → Define → Plan → Build → Verify → Review
Specification None. Build starts immediately Spec written and approved before any code starts
Task planning Implied from the prompt Explicit ordered task list reviewed before build begins
Decision tracking Decisions lost in chat history Every decision recorded as a versioned artifact in your repo
Code review Optional, often skipped under pressure Structured agent review at every stage before merge
Verification Manual or skipped Automated checks run after build: tests, quality, accessibility
Audit trail Limited or none Full artifact history: spec, plan, build summary, review, report
Context switching Spec in one tool, tasks in another, reviews elsewhere Everything in one panel, inside your editor

The difference is not just process for process’s sake. Each row represents a category of mistake or gap that shows up in production when it is skipped.

Catching problems earlier

AI-generated code is only as good as the information provided to it. A vague prompt can produce code that works while still missing important requirements or edge cases.

The Project Manager introduces checkpoints before code reaches production. Specifications capture assumptions early, planning helps identify gaps, verification validates the implementation, and review provides another layer of quality checks.

This makes it easier to catch problems when they’re still inexpensive to fix rather than after deployment.

Why this matters

Imagine adding multi-factor authentication to a production application. Six months later, another developer needs to modify the login flow. Without any record, they are left guessing why decisions were made. With a spec, a task plan, and a code review saved alongside the code, they can understand what was built and why, without asking anyone.

That is the real value of Project Manager. It is not just about generating code faster. It is about keeping the context, the decisions, and the evidence of quality long after the code is merged. That record matters across situations teams encounter regularly:

  • Production incidents: Trace what changed, why it changed, and what was checked before it shipped.
  • Compliance audits: Show proof that security reviews happened, requirements were documented, and testing was completed.
  • Onboarding new developers: New hires can read the reasoning behind decisions without pulling in a senior developer to explain.
  • Regulated industries: Provide formal documentation of the design and review process before changes go to production.
  • Security reviews: Demonstrate that authentication changes and input handling were reviewed and signed off before merging.

Project Manager produces this record automatically as a normal part of getting work done.

Walking through a real feature build: Adding CSV export to a bug tracker

To see how Project Manager works in practice, let’s use a realistic example.

Imagine you’re working on an internal bug tracker with three statuses:

  • Open
  • In Progress
  • Fixed

Users can filter issues by status, and the next request is straightforward: add a CSV Export button that downloads the currently filtered results so the team can analyze them in Excel.

Step 1: Opening the panel and setting up your project

Open the Project Manager panel from the Code Studio settings. The first thing you see is a welcome screen with two options:

  • Set up existing project: Scans your workspace and creates project knowledge files automatically.
  • Start new project: For new projects where the agent helps you set everything up from scratch.

Since the bug tracker project already exists, we can choose the Set Up Existing Project option. The agent scans your workspace:

  • Folder structure,
  • Component names,
  • Tech stack, and
  • coding patterns.

Then, it creates a set of knowledge files inside your project with the required details:

  • architecture.md: Component structure and state management approach.
  • stack.md: Frameworks, libraries, and tooling versions.
  • conventions.md: Naming patterns, styling approach, and test patterns.
  • boundaries.md: Rules like “never use class components” or “always wrap localStorage calls in try-catch”.
  • codestudio-instructions.md: A combined context file the agent uses on every task going forward.

This setup only takes a minute, but it gives the AI agent something many coding assistants lack: a working understanding of your codebase before implementation begins.

Setting up the project
Setting up the project

Step 2: Describe the requirement

Next, you create a new task and enter:

Add an Export CSV button for this bug tracker application. Clicking it downloads the issues currently visible based on the active filter — Open, In Progress, or Fixed.”

That’s the only instruction required.

From this point forward, the Project Manager guides the task through a structured development process.

Step 3: Define: Align on requirements before writing code

“Every successful implementation starts with a shared understanding of what is being built.”

As soon as you submit the CSV export request, the Project Manager enters the Define stage. The remaining stages: Plan, Build, Verify, and Review stay locked until the requirements are approved.

The agent does three things in sequence:

  1. Scans your codebase: It reads your knowledge files, understands your component structure, and figures out where the export feature fits in your existing code.
  2. Creates a spec: Based on your prompt and its codebase scan, it writes a spec.md covering what is being built, the key design decisions, and a list of assumptions it has made.
  3. Asks for your approval: The spec appears as an artifact (“CSV Export Feature Specification”) with a Review badge. You click it, read through the document, and decide whether it matches what you actually want.

The spec covers the button placement, file contents, filter handling, and the key assumptions validated, before a single line of code is written. Read through it, confirm it matches what you want, and click Approve & Continue.

Note: This stage does not always run. The agent reads your task description and decides automatically. Adding a new feature? Define runs. Fixing a typo or a minor config value? It skips. If you want the Define stage to always run for every task, you can configure that in the Settings tab.

Define stage
Define stage

Step 4: Plan stage: The agent breaks the work into an ordered task list

“Planning transforms requirements into a sequence of executable steps.”

The agent reads the approved spec, scans your codebase to understand what exists and what needs to be created, and returns a plan.md broken into ordered phases, what to build first, what to test, and what to verify. Review the task breakdown and click Approve & Continue.

Plan stage
Plan stage

Step 5: Build stage: The agent implements the feature

“AI can generate code quickly. A plan ensures it generates the right code.”

The agent works through the plan task by task, building the logic, wiring up the UI, and writing tests as it goes. You can watch progress in the panel as each task checks off. When done, a build summary artifact shows what was built, which files changed, and what tests were added. Confirm it matches the spec and plan, then click Approve & Continue.

Build stage
Build stage

Step 6: Verify stage: The agent runs the checks so you don’t have to

“Code that works locally is not always code that’s ready for production.”

The agent runs tests, builds validations, code-quality checks, and accessibility checks. No manual configuration is needed because it already knows what to check from the specification. Every check comes back clean: tests passing, build successful, export button accessible by keyboard. Review the verification report and click Approve & Continue.

Verify stage
Verify stage

Step 7: Review stage: The agent reviews the code before it merges

“A review is where implementation quality becomes visible.”

The agent reads the code it just wrote and reviews it across correctness, readability, architecture, security, and performance—the same areas a senior engineer would evaluate. Issues surface here if there are any; if everything is clean, that is documented too. The review comes back clean. Verdict: Approved for Merge. Click Approve & Continue.

Review stage
Review stage

And that’s the full run, done.

All stages are complete. Every artifact: the specification, the implementation plan, the build summary, the verification report, and the code review is saved to your repository. Use View in History to see the full record or Start New to begin the next task.

You described what you needed. The process ran. Nothing was skipped.

Adding a CSV export to a bug tracker using Project Manager in Code Studio
Adding a CSV export to a bug tracker using Project Manager in Code Studio

Understanding the Project Manager panel

Project Manager is organized into five tabs, each designed to support a different part of the software delivery process.

1. New Task

Every task starts here. Simply describe what you want to build, and Project Manager takes it from there.

It uses your project’s context to understand the request, determine its scope, and automatically start the appropriate process. If you need to step away, you can Pause the task and resume later or Cancel it entirely.

2. Plugins

Plugins provide additional knowledge about specific frameworks, libraries, and tools. Instead of repeatedly explaining your technology stack, you can install a plugin once and make that expertise available whenever needed.

Plugins can be browsed and installed from:

  • All
  • Syncfusion
  • Community

Once installed, they can be attached to tasks as additional context for the agent.

3. Knowledge

The Knowledge tab contains the project context files that help the agent understand your codebase, including:

  • architecture.md
  • stack.md
  • conventions.md
  • boundaries.md
  • codestudio-instructions.md

These files can be viewed and edited directly. After significant codebase changes, selecting Refresh All updates them so the agent’s understanding stays aligned with the project.

4. History

Every task executed through Project Manager is recorded in History.

For each task, you can review:

  • Task description
  • Process level used
  • Completed stages
  • Timestamps
  • Generated artifacts

This creates a searchable record of how a feature evolved from initial requirements through implementation, verification, and review.

5. Settings

The Settings tab allows you to control how much process is applied to a task and how involved you want to be along the way.

1. Process levels

Choose how thorough the process should be:

  • Quick: Plan, Build, Verify. Ideal for small changes.
  • Standard: Define, Plan, Build, Verify, Review. Recommended for most feature development.
  • Thorough: Includes all stages plus additional release readiness checks.
  • Maximum: Adds extra quality gates for high-risk changes such as authentication, payments, or data-sensitive features.

Quality gates are applied automatically based on the type of change. For example:

  • Accessibility checks for UI updates.
  • Security checks for authentication and user input handling.
  • Performance checks for sensitive code paths.

2. Approval modes

You can also decide how much oversight you want during execution:

  • Review each step: The agent pauses after every stage and waits for approval.
  • Run automatically: The agent completes all stages before presenting the final results for review.
Panel settings in Project Manager
Panel settings in Project Manager

Who benefits most from Project Manager?

Project Manager is especially valuable for teams that use AI coding tools regularly but still need visibility, quality control, and traceability throughout development.

  • Developers using AI daily: Get more than generated code. Every task includes documented requirements, implementation decisions, and review history, making future maintenance easier.
  • Engineering managers: Gain a clear record that specifications, verification checks, and reviews were completed before changes moved forward.
  • Teams onboarding new developers: New team members can understand not just what was built, but also the decisions and reasoning behind it.
  • Projects where reliability matters: Whether you’re working on authentication, payments, APIs, data processing, or customer-facing applications, Project Manager helps ensure important review and validation steps don’t get overlooked.

In short, Project Manager is most valuable for teams that want the speed of AI-assisted development without sacrificing quality, accountability, or long-term maintainability.

Frequently Asked Questions

Can I skip stages in the Project Manager development process?

Light-level processes do not include the Define or Review stages by design. For Standard and higher process levels, stages cannot be skipped. If a stage feels unnecessary for your project, you can choose a lower default process level in Settings.

Can I run multiple Project Manager processes at the same time?

No. Only one Project Manager process can be active at a time. Starting a new process while another is in progress will archive the current one first.

Where does Project Manager store specifications, plans, and review artifacts?

All generated artifacts, including specifications, implementation plans, verification reports, and code reviews, are stored in your project’s version-controlled configuration directory and travel with your repository.

What happens to a Project Manager task when I switch Git branches?

Project Manager automatically detects branch changes. If the new branch already contains a saved process state, it loads that state. Otherwise, the current process remains preserved until you switch back.

Can I use Code Studio's AI agent without following the full Project Manager process?

Yes. You can use the AI chat and coding agent independently. The structured Define → Plan → Build → Verify → Review process is optional and only starts when you create a task through Project Manager.

Does Project Manager work with any programming language or framework?

Yes. The Project Manager process is language-agnostic. While onboarding, it scans your workspace to understand your technology stack and adapts its guidance accordingly, making it suitable for virtually any project with a recognizable structure.

Plan, Code, and Deliver Faster with AI

Use AI agents to create implementation plans, generate production-ready code, automate repetitive tasks, and improve code quality across your projects.

Discover Code Studio

From faster code to better software delivery

AI can generate code in seconds. The harder challenge is making sure that code remains understandable, reviewable, and maintainable long after it ships.

That’s where Project Manager changes the experience. Instead of leaving specifications, implementation decisions, verification results, and code reviews scattered across multiple tools or missing altogether, it keeps them connected to the work itself.

The result is more than a complete feature. You get:

  • Clear requirements before implementation begins,
  • A documented plan before changes are made,
  • Automated verification before deployment, and
  • Reviewable decisions that remain available months later.

If you’ve ever traced a production issue back to missing context, skipped reviews, or undocumented decisions, try running your next feature through Project Manager in Syncfusion Code Studio.

Describe the task once and see how a structured development process can improve not just how quickly code gets written, but how confidently it gets delivered.

Need help getting started? Explore the Project Manager in Code Studio documentation, contact us via our Syncfusion support portal, join the community forums, or share feedback to help shape future releases.

Read the whole story
alvinashcraft
16 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

8 .NET Obfuscators Compared for 2026

1 Share

Point dnSpy or ILSpy at an unprotected .NET assembly and you can get back something close to the original C# in seconds.

Hardcoded secrets, license logic, proprietary algorithms, and business rules can all become easier to inspect when they are left unprotected. That is the case for obfuscation. The harder question is which obfuscator fits how you actually build, what platforms you ship to, and what you are trying to protect against.

This guide compares eight .NET obfuscators across features, platform support, pricing, runtime protections, and common use cases so teams can identify the best fit for their development environment and protection requirements.

How we selected these .NET obfuscators

We evaluated tools on protection depth, including renaming, control flow obfuscation, string encryption, tamper detection, debug detection, runtime protections, MSBuild and CI integration, runtime overhead, modern .NET coverage, MAUI support where documented, licensing model, and third-party validation availability.

We sourced third-party signals from G2, Gartner Peer Insights, Trustpilot, vendor documentation, public pricing pages, and practitioner or analyst writeups where available. Because pricing, platform support, and review-site data can change, teams should verify current details with each vendor before purchasing.

Tools without active maintenance or clearly documented modern .NET support are included but flagged explicitly.

Disclosure: PreEmptive, the publisher of this guide, makes Dotfuscator, one of the tools included in this comparison. Dotfuscator is evaluated using the same criteria as the other tools in this list, including protection depth, platform support, runtime protections, CI/CD integration, licensing model, and publicly available validation. This guide is organized by use case rather than presenting one universal “best” option.

ToolBest ForModern .NET / MAUI SupportRuntime ChecksCI IntegrationLicensingStarting Price
.NET ReactorCommercial ISVs.NET Framework, .NET 5-10, .NET Core, ASP.NET Core, Xamarin, Unity, and Blazor documented; MAUI should be verified directlyAnti-tamperCommand line, Azure DevOps tasks, and GitHub ActionsPerpetual$249
Eazfuscator.NETIndividual devs and small teams wanting build-integrated protection.NET 10 support and improved MAUI support documented; Xamarin support should be verified for your target projectNo built-in tamper/debug response layer prominently documentedNuGet / build integration, with Linux support now documentedPerpetual$399
SmartAssemblyNET Framework and .NET Core teamsNET Framework, .NET Core, and .NET Standard documented; MAUI not clearly documentedTamper and error reporting, depending on editionMSBuildSubscriptionVendor pricing varies by tier; verify current pricing
Babel ObfuscatorMAUI / Blazor / Unity and broad platform coverageBroad .NET platform support, including MAUI-related licensing documentationLicensing features documented; RASP-style runtime response should be verifiedWindows, macOS, LinuxPerpetual350 € Enterprise; 1,250 € Ultimate
ObfuscarOpen-source projectsModern .NET support documented through NuGet; MAUI support should be verifiedNoneNuGet, cross-platformMITFree
Dotfuscator ProfessionalRegulated enterprise and teams needing static obfuscation plus runtime defenses.NET (all versions), .NET Core, MAUI, WinForms, ASP.NET, UWP, and Xamarin, support documented across PreEmptive materialsTamper + debug + RASPMSBuild, command line, and CI pipelinesSubscriptionFree trial available
Agile.NETNinjaTrader and Windows-based .NET teams needing virtualizationModern .NET support should be verified for your target framework; Windows-focusedVM virtualizationWindows onlySubscriptionDeveloper license starts at $795 + maintenance; Enterprise listed at $150/mo paid annually
ConfuserEx 2Legacy .NET FrameworkFramework-focused; modern .NET support is limited or fork-dependentAnti-tamper + anti-debugMSBuildMITFree

1. .NET Reactor: Best for Commercial ISVs That Need Built-In Licensing Alongside Obfuscation and Public, Predictable Pricing {#net-reactor}

NET Reactor

.NET Reactor bundles NecroBit code encryption, control flow obfuscation, string encryption, anti-tamper, and a full software licensing API (serial key generation, hardware ID locking, trial expiry) in a single perpetual-license product. For ISVs that would otherwise buy and integrate a separate licensing system, that’s a second tool they don’t have to buy.

The tool also documents support for .NET Framework, .NET 5-10, .NET Core, ASP.NET Core, Xamarin, Unity, and Blazor assemblies. Its documentation lists command-line usage, DevOps tasks, and GitHub Actions integration, so the original “Windows agents only” framing is too limiting. Teams should still validate their exact runner, OS, and protection feature requirements before standardizing on it.

What we like:

  • Company license ($549) explicitly includes Azure DevOps and GitHub Actions build server support. Pricing and scope are fully public.
  • Perpetual license with ~$99/year renewal makes long-term cost predictable and lower than subscription alternatives.

Watch out for:

  • MAUI support is not prominently documented in the same way as Xamarin, Unity, and Blazor, so teams building MAUI applications should verify compatibility before purchasing.
  • Not listed on G2, Capterra, or Gartner Peer Insights as of April 2026. Independent star ratings are unavailable; practitioner evidence depends on forum consensus and the NDepend post.

Pricing. Perpetual + 1 year updates. Single Developer: $249. Company (includes build server): $549. Renewal: ~$99/year.

2. Eazfuscator.NET: Best for Individual Developers and Small Teams Wanting Full-Feature Obfuscation with NuGet Pipeline Integration {#eazfuscator}

Eazfuscator

Eazfuscator.NET integrates via NuGet. Protection is declared in the .csproj and runs automatically as part of dotnet build, so it cannot be accidentally skipped. Eazfuscator makes protection part of the build graph rather than an extra release task.

Eazfuscator also includes code virtualization, replacing CIL with a protected representation that makes static analysis harder. That capability is absent from Dotfuscator Professional and SmartAssembly. The tool now documents .NET 10 support, improved MAUI support, and Linux support in recent release notes. The vendor reports over 3,000 commercial customers, though that figure is vendor-reported and should be treated as such.

Watch out for:

  • No built-in runtime tamper detection or debug detection is prominently documented as part of the core positioning. Teams with runtime integrity requirements need to accept that layer is absent or add a second tool.
  • Older comparisons often describe Eazfuscator as Windows-only, but recent release notes state that Eazfuscator.NET can now run on Linux. Teams should still test their exact build environment before purchase.
  • Not a fit for regulated teams that need documented tamper response or audit-ready runtime self-protection.

Pricing. Perpetual. Single Developer: $399. Site License (unlimited devs, one company): $1,699.

3. SmartAssembly: Best for .NET Framework and .NET Core Teams That Want Obfuscation Bundled with Automated Crash Reporting {#smartassembly}

SmartAssembly

SmartAssembly is Redgate’s .NET obfuscator. Its distinguishing feature is built-in automated error reporting: the Pro edition captures unhandled exceptions in production and surfaces them in a dashboard, tying obfuscation and crash analytics together in one tool.

If you’d rather see your production crashes than maximize obfuscation depth, SmartAssembly’s the trade. Eazfuscator goes deeper on protection but gives you nothing for triage. It covers name mangling, control flow obfuscation, string encoding, reference dynamic proxy, and method parent obfuscation across .NET Framework, .NET Core, and .NET Standard assemblies.

Watch out for:

  • No MAUI support is clearly documented on the current product page. Verify coverage before purchasing if MAUI is in scope.
  • Tamper protection and production error reporting depend on edition and configuration, so compare Standard versus Pro carefully before purchasing.

Pricing: Annual subscription, per license. Current vendor pricing should be verified because pricing and package names can change.

4. Babel Obfuscator: Best for .NET Teams Needing MAUI, Blazor, Unity, and Xamarin Coverage in a Single Cross-Platform Tool {#babel}

Babel

Babel Obfuscator covers .NET 5-9, .NET Core 2.x/3.x, .NET Framework 2.0-4.x, .NET MAUI, ASP.NET, Blazor, Xamarin (Android and iOS), Unity, UWP, Silverlight, nanoFramework, and Mono. Babel’s documentation also includes MAUI-related licensing examples, making it a candidate for teams with cross-platform .NET application portfolios.

Build support is cross-platform across Windows, macOS, and Linux, so the build step executes natively on Linux runners without a Windows agent. Code virtualization and method bytecode encryption are included in the Ultimate tier. For teams with unusual platform mixes (Unity game plus MAUI mobile plus Blazor web), Babel is the only single-vendor answer.

Watch out for:

  • External validation appears thinner than for some larger commercial tools. If review-site evidence matters in your buying process, evaluate Babel directly and ask the vendor for customer references.
  • Babel Licensing is documented separately and can support software licensing workflows, but built-in RASP-style runtime tamper response should be verified before treating it as equivalent to Dotfuscator’s runtime protection layer.

Pricing: Perpetual, one-time purchase. Current shop pricing lists Babel Obfuscator Enterprise at 350 € and Ultimate at 1,250 €, with maintenance terms described separately.

5. Obfuscar: Best for Solo Developers and Open-Source Projects That Need Basic Renaming with Zero Licensing Cost {#obfuscar}

Obfuscar

Obfuscar is an MIT-licensed, actively maintained open-source .NET obfuscator from LeXtudio Inc., installable as a NuGet global tool with 2.6 million+ combined downloads, according to vendor-reported NuGet data. It supports modern .NET, including .NET 10, and runs on Linux and macOS build agents. It applies symbol renaming and XOR-based string encoding.

Obfuscar’s appeal is simple: zero cost, zero procurement, and NuGet-native integration. For open-source projects, personal tools, or low-risk internal utilities, it can provide a reasonable first layer of protection without adding commercial licensing overhead.

Watch out for:

  • No control flow obfuscation, tamper detection, or debug detection. Obfuscar is best understood as a lightweight baseline, not a layered application protection strategy.
  • XOR-based string encoding is weaker than the stronger string encryption used by many commercial tools. A determined analyst with dnSpy can still reconstruct meaningful logic from a renamed-only assembly.
  • Not the right fit for most commercial buyers. Teams protecting proprietary algorithms, licensing logic, or regulated software should evaluate a commercial tool with deeper static protection and runtime defenses.

Pricing: Free, MIT license.

6. Dotfuscator (Community + Professional): Best for Regulated Enterprise .NET Teams Requiring Runtime Defenses Alongside Static Obfuscation {#dotfuscator}

NET_PRE

Dotfuscator by PreEmptive is the only third-party .NET obfuscation tool embedded directly in Visual Studio and subject to Microsoft’s regression tests, code audits, and security reviews since 2003. 

Dotfuscator Community is available to many Visual Studio users as an accessible first layer of protection, and is beneficial for individual projects. Dotfuscator Professional adds the protections that matter most for commercial and regulated software teams. Teams should verify Community availability and licensing terms for their specific Visual Studio version and use case.

Dotfuscator Professional adds the differentiators that matter for regulated work. It runs fully on-premises, so teams can protect .NET applications without uploading source code, assemblies, or proprietary IP to external SaaS tools or unknown build environments. Overload Induction renaming assigns the same name to as many methods as possible by exploiting method overloading, making call graph reconstruction harder.

Tamper detection is configurable with graduated response (log, restrict, exit), so teams can collect attack telemetry before tipping off the attacker. Debug detection, runtime application self-protection features, RASP injected at the binary level with no external agent, and Shelf Life expiration logic complete the runtime layer.

Dotfuscator’s product materials also emphasize layered protection for .NET, C#, and MAUI applications, including protections against reverse engineering, tampering, and unauthorized debugging. If using third-party ratings or customer logos in this section, verify the current G2, Gartner, and customer roster details before publishing.

Watch out for:

  • Pricing is quote-based and tailored to each organization’s deployment needs, team size, and protection requirements. Teams evaluating Dotfuscator Professional should request pricing directly from PreEmptive to understand the right package for their environment.
  • Advanced exclusion configuration for reflection-dependent code and symbol map management has a learning curve. Public review summaries also suggest that some advanced configuration scenarios may benefit from stronger documentation.
  • No code virtualization. Teams with extreme reverse-engineering threat models may want an additional layer. See our discussion of layered defense techniques for context on where virtualization fits.

Pricing. Community: free (included with Visual Studio), best for individuals developers or projects. Professional: subscription, quote-based, best for commercial/enterprise teams. See Dotfuscator 101 for a walkthrough of the configuration model.

7. Agile.NET (SecureTeam): Best for NinjaTrader and Algorithmic Trading Developers That Need VM-Based Code Virtualization on Windows {#agilenet}

Agile_NET

Agile.NET applies patented technology to transform MSIL into virtual opcodes executed by a proprietary secure VM. This virtualization defeats static analysis (no readable CIL) and dynamic analysis, so standard .NET debuggers cannot observe the execution.

Where Obfuscar only renames, Agile.NET virtualizes. SecureTeam positions Agile.NET for code protection against reverse engineering, piracy, code theft, and tampering, and its public pricing page lists both developer and enterprise options.

Watch out for:

  • Public validation appears limited compared with larger review platforms, so buyers should test support responsiveness and license delivery during evaluation.
  • Not listed on G2, Capterra, or Gartner Peer Insights. Independent validation is limited to Trustpilot.

Pricing. Subscription. $150/month, paid annually. Windows only.

8. ConfuserEx 2: Best for Legacy .NET Framework Projects Where Free, Feature-Rich Obfuscation Is Acceptable and Active Maintenance Is Not Required {#confuserex}

ConfuserEx

ConfuserEx 2 is a free, MIT-licensed .NET obfuscator supporting .NET Framework 2.0-4.8, .NET Standard, .NET Core, and Mono. On paper its feature set exceeds most commercial tools: symbol renaming, control flow obfuscation, anti-debug, anti-tamper (method encryption), constant encryption, resource encryption, and WPF/BAML renaming.

The critical caveat, stated plainly: the original ConfuserEx repository is discontinued and unmaintained, and modern .NET support depends on forks rather than the original project. Deobfuscation tools evolve, so protection that was effective several years ago may be easier to bypass today.

WPF/BAML renaming is missing from some commercial tools, so for legacy WPF apps with no path to modern .NET, ConfuserEx or a maintained fork may still be worth evaluating. For actively developed .NET 6+ applications, treat it as a risky default choice unless your team has validated the specific fork, framework version, and maintenance status.

Pricing. Free, MIT license.

How to Choose: By Development Context and Scale

Three scenarios cover most buying decisions in this category. Match your context to the row.

ScenarioRecommended PickWhy
Solo developer or open-source projectDotfuscator Community or ObfuscarZero cost, zero procurement; Community ships with every Visual Studio install; Obfuscar covers Linux CI and modern .NET
Commercial ISV shipping licensed softwareDotfuscator Professional, .NET Reactor ($549), or Eazfuscator.NET ($399)Full-feature static obfuscation with public or quote-based licensing; .NET Reactor adds a licensing API; Eazfuscator adds virtualization
Regulated enterprise requiring runtime defensesDotfuscator ProfessionalThe only tool combining configurable tamper detection, debug detection, RASP, and 30 years of Fortune 500 validation; maps to PCI DSS and HIPAA technical safeguard requirements and generates audit-ready evidence

How to Choose: By Protection Priority

If company size is not the primary filter, use the priority table below.

PriorityRecommended PickWhy
Lowest total costObfuscar (modern .NET) or ConfuserEx 2 (legacy Framework only)Zero licensing cost; NuGet-native; Obfuscar is the safer choice for actively developed projects
Maximum protection depth (static + runtime)Dotfuscator ProfessionalOverload Induction renaming, control flow obfuscation, string encryption, configurable tamper detection, debug detection, RASP, and Shelf Life in a single tool
Easiest CI/CD integration with public pricing.NET Reactor Company license ($549)Fully documented pricing, Azure DevOps and GitHub Actions support named in the license, perpetual model with predictable renewal

Start with a Protected Build Before Your Next Release

The decompiler round-trip problem is the same across all eight tools. How many layers of friction you want between your MSIL and an attacker’s reconstructed C# is the decision that separates them.

Solo developers should start with Dotfuscator Community or Obfuscar, depending on whether they are working inside Visual Studio or need a lightweight open-source option. Commercial ISVs should evaluate .NET Reactor, Eazfuscator.NET, Babel Obfuscator, and Dotfuscator Professional, with the choice driven by whether built-in licensing, virtualization, cross-platform build support, or runtime defenses is the higher priority.

Regulated enterprises should prioritize tools that do more than rename symbols. For teams that need static obfuscation plus runtime tamper response, debug detection, and documented protection workflows, Dotfuscator Professional is the strongest fit in this list.

Dotfuscator Professional offers a free trial

For background on where obfuscation fits in a broader defense, see our guide to application hardening techniques.


Frequently Asked Questions About .NET Obfuscators

Does obfuscation affect .NET application performance?

Static obfuscation (renaming, string encryption, metadata removal) adds no measurable runtime overhead. Control flow obfuscation can introduce a small cost in tight loops, typically under 2% for most applications. Performance-critical paths should be tested against the obfuscated binary before shipping. See our obfuscation performance analysis for detailed benchmarks.

Will obfuscation break my application?

The most common breakage point is symbol renaming applied to reflection-dependent code, serialized types, or methods invoked by name at runtime. Every commercial tool in this list supports exclusion lists or namespace whitelisting to prevent this. The fix is configuration, not avoiding obfuscation. Always run a full regression test suite against the obfuscated binary.

What is a symbol map and why does it matter?

When renaming obfuscation is applied, the tool produces a symbol map that translates obfuscated names back to their originals. Without a versioned, stored symbol map, post-deployment crash reports from obfuscated binaries are unreadable. Store the symbol map in a secure artifact repository linked to the specific build version, not on a shared drive.

Can obfuscated .NET binaries still be decompiled?

Yes. Obfuscation raises the cost and time of reverse engineering. It does not make decompilation technically impossible. A decompiler will still produce output from an obfuscated binary, but the output is harder to read and reconstruct into working logic. Layering static obfuscation with runtime tamper detection produces meaningfully stronger protection than either layer alone.

Does .NET MAUI require a different obfuscation approach?

MAUI applications compile to native binaries on iOS and Android alongside .NET binaries on Windows and macOS. The .NET assembly layer (MSIL) can be obfuscated with tools that explicitly support MAUI. Dotfuscator Professional and Babel Obfuscator both document MAUI coverage; verify support explicitly before purchasing any tool in this list, since several do not document it.

Read the whole story
alvinashcraft
21 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Entra ID Protection – User Risk with Unified Identity Signals from Defender is here!

1 Share

Last Updated on August 6, 2026 by Michael Morten Sonne Introduction My summer vacation is now over, and…

The post Entra ID Protection – User Risk with Unified Identity Signals from Defender is here! first appeared on Blog - Sonne´s Cloud.
Read the whole story
alvinashcraft
29 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Modern C# URI Handling: Absolute, Relative, Query & Fragment URLs

1 Share

This is a modern companion to my original post on how to convert C# URI/URL to Absolute or Relative.

You handle URLs in almost every application, whether it's a web application or not. Some of them are absolute, like https://example.com/customers/details, and some are relative, like /customers/details. Converting between the two is the kind of small utility code that gets written once and then copied between projects for years.

I wrote exactly that set of extension methods in 2017, and they still work. What needed updating is mostly in the helper code rather than in the platform: the original methods don't always carry the query string and fragment along, and they hide the cases where a conversion can fail instead of expressing them with a nullable return type.

In this article, we'll go through the four concepts in play: absolute and relative URI kinds, the components a URL is built from, converting in each direction, and an updated version of those extension methods.

Absolute and Relative URI Kinds

A Uri is either absolute or relative, and it's decided when you construct it. When the input could be either, say so with UriKind.RelativeOrAbsolute:

var uri = new Uri("/products?id=42#details", UriKind.RelativeOrAbsolute);

Console.WriteLine(uri.IsAbsoluteUri); // False

Check IsAbsoluteUri before you touch anything else. Nearly every useful member, including Query and Fragment, is absolute-only and throws an InvalidOperationException on a relative instance. The ones that are always safe are OriginalString, ToString(), and IsAbsoluteUri, which is why URL helpers tend to branch on IsAbsoluteUri and fall back to OriginalString.

The Parts of a URL

For the absolute URL https://example.com/orders/42?include=items#summary:

MemberValue
Schemehttps
Authorityexample.com
AbsolutePath/orders/42
Query?include=items
Fragment#summary
PathAndQuery/orders/42?include=items
AbsoluteUrihttps://example.com/orders/42?include=items#summary

Query and Fragment include their leading ? and #, and both give you an empty string rather than null when the component isn't there, so you can concatenate them without a null check.

PathAndQuery is the one to watch, since it's what most root-relative helpers are built on and it covers only two of the three parts. Appending Fragment is all it takes to keep the whole thing.

Convert a Relative URL to an Absolute URL

Pass an absolute base URI and the relative URI to the Uri(Uri, Uri) constructor, which resolves the reference the same way a browser resolves a link in a page:

var baseUri = new Uri("https://example.com/customers/");
var relativeUri = new Uri("../orders/42?include=items#summary", UriKind.Relative);

Console.WriteLine(new Uri(baseUri, relativeUri));
// https://example.com/orders/42?include=items#summary

The trailing slash on the base URI is not decoration. It decides whether the last segment is treated as a directory or as a file:

var directoryBase = new Uri("https://example.com/customers/");
var fileBase = new Uri("https://example.com/customers");

Console.WriteLine(new Uri(directoryBase, "42")); // https://example.com/customers/42
Console.WriteLine(new Uri(fileBase, "42"));      // https://example.com/42

Use Uri.TryCreate instead of the constructor when the value comes from configuration, a database, or anywhere else it might not parse.

Be clear about what that buys you, though. Uri.TryCreate tells you the value parsed, not that it's a URL you should use. It accepts any registered scheme, and it returns a URI on a different host when the value is absolute on its own, so untrusted input still needs a scheme check and, when the result has to stay under your base URI, Uri.IsBaseOf.

Convert an Absolute URL to a Relative URL

A relative reference can take several forms in RFC 3986, including ones that start with //, ?, or #. Two of them come up most often in application code, and picking the wrong one is a common source of broken links.

For a root-relative URL, one that starts at the site root, combine the components yourself:

var uri = new Uri("https://example.com/orders/42?include=items#summary");

Console.WriteLine(uri.PathAndQuery + uri.Fragment);
// /orders/42?include=items#summary

For a URL relative to a specific directory, use MakeRelativeUri, which keeps the query and fragment for you:

var baseUri = new Uri("https://example.com/customers/");
var target = new Uri("https://example.com/orders/42?include=items#summary");

Console.WriteLine(baseUri.MakeRelativeUri(target));
// ../orders/42?include=items#summary

The trailing slash matters here too. Drop it from the base and you get orders/42?include=items#summary instead, because customers is then treated as a file rather than a directory.

MakeRelativeUri only produces a relative URI when the scheme and host match on both sides. When they differ, it returns the target URI unchanged, so check IsAbsoluteUri on the result whenever the two could point at different hosts.

The Updated Extension Methods

The 2017 versions, brought up to date:

public static class UriExtensions
{
    public static string ToRelative(this Uri uri)
    {
        return uri.IsAbsoluteUri
            ? uri.PathAndQuery + uri.Fragment
            : uri.OriginalString;
    }

    public static string? ToAbsolute(this Uri uri, string baseUrl)
    {
        return Uri.TryCreate(baseUrl, UriKind.Absolute, out var baseUri)
            ? uri.ToAbsolute(baseUri)
            : null;
    }

    public static string? ToAbsolute(this Uri uri, Uri baseUri)
    {
        return Uri.TryCreate(baseUri, uri.ToRelative(), out var absolute)
            ? absolute.AbsoluteUri
            : null;
    }
}

Three things changed. ToRelative appends Fragment so the whole URL survives the round trip. The string overload parses the base URL with Uri.TryCreate instead of a constructor that throws. And the result comes from AbsoluteUri rather than ToString(), because ToString() returns a canonical form with most escaping decoded, while some reserved characters stay escaped. AbsoluteUri gives you the fully escaped text you want in an href or a header.

They're used the same way as before:

var absoluteToRelative = new Uri("https://www.test-relative.com/customers/details.html#terms")
    .ToRelative();
// "/customers/details.html#terms"

var relativeToAbsolute = new Uri("/orders/id-123/", UriKind.Relative)
    .ToAbsolute("https://www.test-absolute.com");
// "https://www.test-absolute.com/orders/id-123/"

Summary

Most conversion bugs come from a helper that carries fewer parts of the URL than you assumed, usually the path and query without the fragment.

  • Construct with UriKind.RelativeOrAbsolute when the input could be either, then branch on IsAbsoluteUri before reading anything else.
  • Use PathAndQuery + Fragment for root-relative URLs, and MakeRelativeUri for URLs relative to a specific directory.
  • Give base URIs a trailing slash when the last segment is a directory, in both directions.
  • Prefer Uri.TryCreate over the constructor for values you didn't produce yourself, and AbsoluteUri over ToString() for the string you pass on.

All output above comes from running the code on .NET 10. For the original compact implementation, see Convert C# URI/URL to Absolute or Relative.

Read the whole story
alvinashcraft
35 seconds ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories