Microsoft Copilot Studio is at the forefront of conversational AI and automation, empowering organizations to build, customize, and manage intelligent copilots and bots for a wide range of enterprise scenarios. As the platform has evolved, so too have the technologies underpinning it. Central to Copilot Studio’s innovation is its deep integration with .NET, including the use of .NET on WebAssembly (WASM). This post explores how Copilot Studio utilizes .NET, the benefits realized from platform upgrades, and the resulting performance, cost, and productivity improvements.
How Copilot Studio uses .NET
Copilot Studio is a low-code experience for creating conversational and autonomous agents, but the runtime executing those agents is based on .NET.
Copilot Studio leverages .NET’s WebAssembly (WASM) capabilities to run C# code directly in the browser, enabling advanced features such as real-time Power Fx formula evaluation, intelligent validation, and responsive user experiences within the low-code Copilot Studio environment. By running the same validation and expression parsing code on the client and server, Copilot Studio ensures consistent behavior and execution.
Optimizing .NET WebAssembly usage
Copilot Studio uses advanced techniques to optimize client code execution when running on WebAssembly. The .NET WASM runtime is loaded from a web worker to allow for heavy-duty processing off the main UI thread. This ensures that even complex bots and automations remain highly responsive.
The system also employs a dual-mode loading strategy to speed up app load time performance. .NET supports two different execution models for running on WebAssembly:
- Interpreted: .NET assembly code is interpreted at runtime with some partial just-in-time (JIT) compilation support to WASM. Build times are fast, the runtime is smaller, but runtime performance is slower.
- AOT (ahead-of-time) compilation: Used in production for maximum performance, C# code is compiled to WASM bytecode when the app is published. This mode delivers substantial runtime speedups, especially for larger bots and formula evaluations, but at the cost of a larger download size.
To optimize load time performance, Copilot Studio launches both JIT and AOT downloads in parallel at startup. The JIT engine enables immediate interaction, while the AOT engine takes over once ready, seamlessly transferring state and freeing memory from the JIT engine. This hybrid approach delivers fast startup and best-in-class execution speed for end users.
Dynamic assembly loading
Copilot Studio uses three key technical features to efficiently load and initialize a .NET WebAssembly application in a web worker:
[JSImport]/[JSExport]attributes: These attributes are part of the .NET JavaScript interoperability system and allow .NET methods to be called from JavaScript and vice versa. This makes it easier to integrate .NET code into web applications and enable direct interaction between the two execution environments.- Dynamically import dotnet.js: This is the entry point for configuring the .NET WebAssembly runtime in the browser. The script exposes the
dotnetobject, which provides several JavaScript methods for configuring and starting the runtime. - Optimize resource loading: The
withResourceLoadermethod allows developers to manually control how resources are loaded into the runtime, such as assemblies and configuration files. In this case, it’s used to retrieve and decompress .br files (compressed with Brotli) and ensure efficient loading of resources from multiple web workers instances.
Performance improvements with .NET 8
Initially, Copilot Studio’s WASM engine was built on .NET 6. The move to .NET 8 brought two primary advantages:
- Long-term support: .NET 8 offers ongoing updates and security patches, ensuring a robust and secure foundation for mission-critical AI solutions.
- Performance and optimization: .NET 8 introduced significant optimizations, resulting in smaller download sizes, faster execution, and improved tooling for developers.
The migration to .NET 8 resulted in remarkable performance gains:
- .NET WASM engine size reduced by ~55%. Thanks to aggressive assembly trimming and improved packaging, the overall download size dropped significantly, accelerating load times and reducing bandwidth costs.
- Faster page and bot load times. Loading times decreased by 56% to 44%, depending on user network conditions, making Copilot Studio snappier and more accessible, especially for users on slower connections.
- Quicker command execution. Response times for executing commands dropped by 26% to 35%, depending on bot complexity. This directly improves the productivity of makers and end users authoring and testing bots.
- Accelerated build and deployment. Compilation and publication time for WASM code is now about 45% faster, streamlining CI/CD pipelines and reducing developer waiting time.

The reduction in WASM engine size and improved build tooling directly translate to lower infrastructure and operational costs:
- Bandwidth savings: Smaller engine downloads mean less data transferred per user session, reducing CDN and hosting costs at scale.
- Efficient caching: Identical system DLLs between JIT and AOT modes are now hashed and cached, avoiding redundant downloads.
- Faster pipelines: Reduced build and publication times allow teams to iterate faster, with lower compute resource consumption.
Developer productivity: tooling and debugging enhancements
Copilot Studio’s engineering teams benefit from .NET’s modern development toolchain:
- Unified build process: Standard
dotnet publishcommands are used to generate WASM packages, simplifying automation and integration with existing DevOps pipelines. - Debugging tools: Debug servers and monitoring tools allow developers to inspect communication between JavaScript and WASM, visualize payloads, and rapidly diagnose issues.
- Rapid iteration: Preview packages can be generated and consumed for quick feedback, and NPM packaging enables easy sharing of WASM modules with frontend teams.
These improvements help teams deliver features faster and with higher quality, while reducing the cognitive overhead of managing complex multi-language integrations.
Enabling innovation in conversational AI
By running .NET in the browser, Copilot Studio empowers low-code and pro-code users alike to build advanced, responsive conversational and autonomous AI experiences. Features like generative answers, tools, and seamless integration with Microsoft’s ecosystem are all underpinned by the flexibility and performance of the .NET platform.
The move to .NET 8 not only keeps Copilot Studio on the cutting edge of security and maintainability but also unlocks new scenarios for AI-powered automation, analytics, and cross-platform extensibility, benefiting both Microsoft and its global customer base.
What’s next?
As .NET continues to evolve, Copilot Studio is committed to partnering with the .NET team to test and adopt the latest platform features. Early experiments with upcoming .NET versions promise even greater performance improvements and tighter integration with JavaScript toolchains. The journey with .NET and WASM is far from over and the future looks bright for conversational AI innovation.
Conclusion
The story of Copilot Studio’s adoption and optimization of .NET on WebAssembly illustrates the power of the .NET ecosystem to drive real-world business value: faster applications, lower costs, and empowered development teams. If you’re building advanced web or AI solutions, consider how .NET and WASM can accelerate your journey, just as they have for Copilot Studio.
0 comments
Be the first to start the discussion.