Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes372downloads
resx-files.md41 linesDownload Raw Back to dev-process
1# Resources2 3Resources are `.resx` files with string values that we use for error messages and such.4They live in `src\<project>\resources` folders.5 6At the moment `dotnet cli` doesn't support generating C# bindings (strongly typed resource files).7 8We are using our own `Start-ResGen` to generate them.9 10Usually it's called as part of the regular build with11 12```powershell13Start-PSBuild -ResGen14```15 16If you see compilation errors related to resources, try to call `Start-ResGen` explicitly.17 18```powershell19Start-ResGen20```21 22## Editing `.resx` files23 24**Don't edit** `.resx` files from Visual Studio.25It will try to create `.cs` files for you and you will get whole bunch of hard-to-understand errors.26 27To edit a resource file, use any **plain text editor**.28A resource file is a simple XML file, and it's easy to edit.29 30## Convert `.txt` resource files into `.resx` files31 32`dotnet cli` doesn't support embedding old-fashioned `.txt` resource.33You can do a one-time conversion of `.txt` resources into `.resx` files with a helper function:34 35```powershell36# example, converting all .txt resources under src\Microsoft.WSMan.Management\resources37Convert-TxtResourceToXml -Path src\Microsoft.WSMan.Management\resources38```39 40`.resx` files would be placed next to `.txt` files.41