Cross compile using codespace from Linux to Windows #108328
-
Select Topic AreaQuestion BodyI am currently developing a CLI tool on a codespace (using c# .NET 8). I am planning to compile it as Native AOT for both Linux and Windows, and perhaps also for Mac. As cross-compiling AOT from Linux to Windows is currently not supported, I am looking for a alternative way to use msbuild on Windows with my current codebase. Because I work from changing locations I am using codespace VSCode in the browser, and avoid installing and maintaining .NET dev on each of the Windows desktops. Everything should ideally happen in the cloud, accessible for me from anywhere. But I am lost, because I am such a noob in so many related things. I feel that there must be many other developers that already solved this problem. But how? So I would be very happy if someone pushes me in the right direction! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Unfortunately, it doesn't seem like Codespaces will support Windows containers anytime soon. I'm not too familiar with C#, but to share what I've done, I develop in an Ubuntu codespace, and use actions to both run test and build release assets. See this project's workflows for some examples. As far as the minutes limit is concerned, you might want to build a Windows version only when creating a release asset, and do all your testing in Linux (assuming you don't have any intended OS-specific behavior). Note that you're also consuming storage and CPU time in your codespace, so using actions may be more efficient for testing and building. You can definitely use docker to compile a Windows utility. See devcontainer features to help with adding docker tools to your devcontainer. But, personally, I'd rather use an action than manually compile a project by using Docker. |
Beta Was this translation helpful? Give feedback.
-
Thank you. |
Beta Was this translation helpful? Give feedback.
Unfortunately, it doesn't seem like Codespaces will support Windows containers anytime soon.
I'm not too familiar with C#, but to share what I've done, I develop in an Ubuntu codespace, and use actions to both run test and build release assets. See this project's workflows for some examples. As far as the minutes limit is concerned, you might want to build a Windows version only when creating a release asset, and do all your testing in Linux (assuming you don't have any intended OS-specific behavior). Note that you're also consuming storage and CPU time in your codespace, so using actions may be more efficient for testing and building.
You can definitely use docker to compile a Windows ut…