.NET on AWS Blog
End-to-end .NET modernization with AWS Transform and Kiro
You can accelerate .NET application modernization with AWS Transform for full-stack Windows modernization—but there may be some follow on work. End-to-end modernization often involves post-transformation tasks to finalize your application for production readiness. By finalize, I mean validating, debugging, and completing your modernized application so that it is ready for use.
In this post, I’ll complete the walkthrough I began in a prior post where I transformed a complex blockchain cryptocurrency suite from .NET Framework to modern .NET with AWS Transform. I’ll use the Kiro AI code companion to finalize the transformed application.
It’s the human reviewer’s responsibility to check the modernized application for correctness, and combining AWS Transform with an AI code companion to quickly address remaining issues is a common pattern. In your modernization journey, think of AWS Transform as the express travel that takes you close to your destination, and an AI code companion as the local travel for those last few miles. They work well together.
The transformed solution builds, but is it correct?
At the end of my previous transformation, I used AWS Transform to modernize a 16-project CryptoCoin suite from .NET Framework 4.8 to .NET 10 and .NET Standard (class libraries), a mix of VB.NET and C# projects. Here’s what it did:
| # | Project | Type | Original version | Target version | Complexity | Key Issues |
| 1 | CryptoCoin.Cryptography | Library | .NET Framework 4.8 | .NET Standard 2.0 | Low | None |
| 2 | CryptoCoin.Core | Library | .NET Framework 4.8 | .NET Standard 2.0 | Low | None |
| 3 | CryptoCoin.Transactions | Library | .NET Framework 4.8 | .NET Standard 2.0 | Low | None |
| 4 | CryptoCoin.Networking | Library | .NET Framework 4.8 | .NET Standard 2.0 | Low | None |
| 5 | CryptoCoin.Mining | Library | .NET Framework 4.8 | .NET Standard 2.0 | Low | None |
| 6 | CryptoCoin.Explorer | Library | .NET Framework 4.8 | .NET Standard 2.0 | Low | None |
| 7 | CryptoCoin.Persistence | Library | .NET Framework 4.8 | .NET Standard 2.0 | Medium | SQLite driver replacement |
| 8 | CryptoCoin.Services | Library | .NET Framework 4.8 | .NET Standard 2.0 | High | WCF services → Web APIs |
| 9 | CryptoCoin.Wallet | Library | .NET Framework 4.8 | .NET Standard 2.0 | Low | None |
| 10 | CryptoCoin.Node | Library | .NET Framework 4.8 | .NET Standard 2.0 | High | Enterprise Library + Castle Windsor replacement |
| 11 | CryptoCoin.WalletCli | Library | .NET Framework 4.8 | .NET Standard 2.0 | Low | None |
| 12 | CryptoCoin.Sdk | Console app | .NET Framework 4.8 | .NET 10 | Low | None |
| 13 | CryptoCoin.Contracts | Console app | .NET Framework 4.8 | .NET 10 | Low | None |
| 14 | CryptoCoin.Tests | Test project | .NET Framework 4.8 | .NET 10 | Medium | MSTet GAC → NuGet |
| 15 | CryptoCoin.Demo | Console app | .NET Framework 4.8 | .NET 10 | Low | None |
| 16 | CryptoCoin.Web.BlockExplorer | Web app | .NET Framework 4.7.2 | .NET 10 | Critical | ASP.NET Web Forms → Razor Pages (18 legacy files) |
Table 1: CryptoCoin projects, complexity, and .NET versions
The resulting .NET 10 solution builds successfully. However, a solution that builds is not necessarily a solution that works. I need to validate that the transformed application looks and behaves like the original. It’s best to plan how you will validate your modernized application in advance before you transform it.
When I validate a transformed application, I look at 4 areas:
- Next Steps: Did AWS Transform give me any Next Steps tasks to address?
- Unit tests: If the solution has unit tests, are they passing?
- Smoke test: Does the app launch and is it nominally working?
- Full validation: Does the application work in full? Can all user tasks be achieved? Does every area of the UI appear correct visually, interact like it should, and exhibit the correct functionality? Is security intact? Are business rules enforced? Is data persisted correctly?
An AI code companion is an essential tool for each of these steps. I’m using Kiro in this walkthrough, but you can use any AI code companion you prefer.
Giving Kiro context
I launch Kiro and open the folder where the transformed solution resides. Then, I give Kiro context with the following prompt:
This solution was recently transformed from .NET Framework to .NET 10.You are going to help me fix issues as I test the modernized application.
It’s sometimes helpful to give Kiro even more context, although it wasn’t necessary in this case. You can tell Kiro to review a folder with the original code for comparison with the transformed code, and you can have it review the transformation report which documents what was changed during the transformation. If you find Kiro struggling with making effective fixes, try giving it this additional context.
1. Next Steps
AWS Transform provided me with a Next Steps markdown file containing post-transformation tasks (shown in Listing 1). Those tasks include required code changes, recommendations, and Linux readiness considerations. It’s a good idea to start here and take care of those tasks before you start validating. Give this to your AI code companion to handle.
Listing 1: Next Steps markdown
I tell Kiro about the Next Steps markdown file and ask it to address the tasks (Figure 1).
The document NextSteps.md contains recommended next steps (remaining modernization tasks) from AWS Transform. Review the document and propose updates to address these tasks.
Figure 1: Kiro working on Next Steps tasks
Kiro gets to work, reviewing Next Steps and planning tasks. One of those tasks is a big one: the wallet service contains stubs and wasn’t fully implemented. After a few minutes, Kiro says it has addressed all of the tasks. Did it do a good job? We’ll find out as we validate the application. Figure 2 shows Kiro’s summary of changes it made. The WalletService was fully implemented, and wired up to the Wallet Manager library. The web UI search form was implemented. The solution was checked for correctness of settings and API key. Files that are no longer needed were removed.
Figure 2: Kiro summary of Next Steps tasks completed
2. Unit Tests
Not all applications have unit tests, but when you have them you should use them. AWS Transform will port any existing unit tests projects in the solution during transformation and run them for you, with results in the transformation report.
The original CryptoCoin had 326 unit tests, which AWS Transform ported to .NET 10 along with the rest of the solution code. When I run Test Explorer, 322 of those test pass and 4 fail (Figure 3).
Figure 3: Some unit tests failing after transformation
Although the majority of unit tests are passing, I of course need all of them to pass. I copy the unit test failure information from Test Explorer to Kiro and ask it to fix the tests (Figure 4).
When I run the unit tests project, 322 tests pass but 4 fail. Help me fix them.<error details>
Figure 4: Putting Kiro to work on failed unit tests
Kiro studies this information, makes code changes, and reports that it has corrected the tests. It indicates it addressed some arithmetic overflow issues and some missing types. When I rebuild and rerun the unit tests, all of them pass (Figure 5).
Figure 5: All unit tests passing
Unit test validation is complete. We don’t yet have confirmation that the application works as a whole, but we’ve confirmed all of the unit tests are passing on the transformed code, which builds confidence.
3. Smoke Test
The next validation step is a smoke test to confirm whether basic functionality is working.
The CryptoCoin suite includes a console app named CryptoCoin.Demo that calls the various class libraries to exercise its core functionality. While this doesn’t include the web front end and the web services, it does serve to confirm whether the components at the core of CryptoCoin are working together correctly.
I launch the demo project, but it fails midway through with a runtime error (Figure 6), a System.OverFlowException exception.
Figure 6: Demo console project runtime error
I give Kiro the exception details and instruct it to resolve the runtime error (Figure 7). It identifies and resolves the issue, again related to arithmetic overflow.
Help me fix a runtime error. The project CryptoCoinDemo is a console program that invokes the class libraries. When I run it, the output gets up to “<output> and then fails with this runtime error: <exception detail>
Figure 7: Putting Kiro to work fixing a runtime error
The analysis (Figure 8) reveals an interesting discovery: the original CryptoCoin library depended on a .NET Framework overflow behavior that is different in modern .NET: .NET Framework unsigned integer arithmetic was implicitly unchecked, whereas modern .NET checks arithmetic by default. I already bumped into this in the prior section when we were fixing unit tests, but now I learn that this is a more fundamental issue. Fortunately, Kiro knows what to do. It adds an arithmetic helper class to provide the behavior the code expects.
Figure 8: Kiro analysis of runtime error and fix
After rebuilding the solution and rerunning the demo project, it now completes without error (Figure 9). My smoke test is now running, and the core functionality of CryptoCoin is confirmed.
Figure 9: CryptoCoin demo project running
4. End-to-end Validation
The final validation step is the most work: does the application fully operate with fidelity to the original? Do all its parts look and function as they should, including front-end UI and back-end services or APIs? Can users successfully perform business tasks end-to-end? Is security intact? Is data persisted correctly?
For CryptoCoin, that means ensuring the app launches and then trying out everything it does. We run its back-end, a project named CryptoCoin.Node, and front-end, a project named CryptoCoin.Web.BlockExplorer. Figure 10 shows the back end and front end after they startup. The back end Node project, shown on the left, runs without error and the console output confirms its hosted services are running. It also begins blockchain mining.
However, the front end website shown on the right doesn’t load at all and has a 404 error. I’m not completely surprised, because AWS Transform did warn me earlier that the website transformation from Web Forms to Razer pages was complex and would require some attention.
Figure 10: Attempt to run back end and front end together
I tell Kiro the website is not loading and it finds the issue. Index.cshtml and other files are missing. It fixes this and when I rerun the code, the website homepage loads (Figure 11). It isn’t styled correctly, but it is functional. I can see that data is retrieved, and links work when I try them.
Figure 11: Website loads and is functional but styling is missing
I tell Kiro the styling is missing and show it what I mean with a screenshot. Kiro corrects the location of the CSS files. Now when I run the website it is much closer to the original (Figure 12).
Figure 12: Website mostly styled correctly but missing
But it’s not perfect. The banner image is missing and navigation isn’t correct. Kiro corrects the site master layout and things are looking better. I test out different functions on the website and it seems to be working well so far (Figure 13).
Figure 13: Website styling restored
I need to be thorough and exhaustive. When I try out the wallet pages, the create wallet function does nothing when I submit the form (Figure 14). There’s some error information on the back end indicating the wallet service could not be reached. I tell Kiro.
When I try the Create Wallet page in the web project, I get this error: Could not create wallet. Wallet service is unavailable. Make sure the node is running. This is the output from the Node project <output>
Figure 14: Website Create Wallet function not working
Kiro finds and corrects some client and service address and port mismatches. Now the wallet functions are working (Figure 15). All of it is working. Validation is now complete and Crypto Coin has been fully modernized.
Figure 15: Create Wallet function working after Kiro fixes
With the application fully validated it is now ready for use.
Conclusion
In this post, I completed a complex modernization with Kiro that I started with AWS Transform. Kiro was an essential partner through each stage of validation. After giving Kiro context on the transformed solution, it handled the Next Steps tasks from AWS Transform, fixed broken unit tests, and debugged a runtime error, in each case with just a single prompt. It also fixed web site styling, navigation, and service connectivity issues, where I gave it a series of prompts as I progressively discovered issues. Kiro not only fixed the issues I asked it to, but it also went above and beyond and provided insightful analysis about arithmetic overflow differences between .NET Framework and .NET, and altered the code to function as originally intended.
AWS Transform and Kiro are a powerful combination for end-to-end .NET application modernization. Get started today with AWS Transform and Kiro.