https://github.com/dotnet/try-convert/ I downloaded this project, built it, but I'm not sure how to actually apply it to projects I want to convert? Might be a rather trivial question but I did poke around quite a bit and can't seem to figure it out.
Thanks!
edit: The readme does gives instructions on how to build and the options but I don't understand how to apply it to to the project. For example -p, --project < P > and I'm assuming the "P" is a placeholder for the file path.
So, I open the command prompt, and run try-convert.exe. Then, I input --project < C:/whatever/whatever > and hit enter. This should result in the file being converted? It's what I tried and it's not working. Is there something I'm missing?
edit edit: Maybe a visual would be easier to articulate my point:
From the README this this the command I'm trying to run
So I run try-convert.exe which is fine and dandy
When I try to convert, No luck
If someone could let me know what I'm doing wrong that would be great!
NET Core Application. In the middle pane on the New Project dialog box, select Console Application (. NET Core) and name it "FirstApp", then click OK. Visual Studio will open the newly created project, and you will see in the Solution Explorer window all of the files that are in this project.
NET 6, though, is ASP.NET Core 6, a major upgrade of Microsoft's open source framework for building modern web applications. ASP.NET Core 6 is built on top of the . NET Core runtime and allows you to build and run applications on Windows, Linux, and macOS. ASP.NET Core 6 combines the features of Web API and MVC.
NET Core installations are completely independent from the version of . NET Framework. In fact, you can actually install multiple version of . NET Core side-by-side on the same machine (unlike .
To upgrade all projects in a solution at once, rather than running try-convert
multiple times (once for each project) you can use the following Powershell script in a command window, after navigating to your solution (or repository) directory:
$paths = Get-ChildItem -include *.csproj -Recurse
foreach($pathobject in $paths)
{
cd $pathobject.directory.fullName
try-convert
}
It's all described in the repository. You don't even have to clone it. You can easily install that as a dotnet global tool with:
dotnet tool install -g try-convert
Then restart the terminal and check if it was installed correctly with:
dotnet tool list -g
Which lists all the tools and tells you what command to use. The help for try-convert is pretty useful, so you can get it with:
try-convert --help
Later you can try to run it on the whole solution which means in the folder where you have your .sln file. However it never worked for me if in at least one of the project I had a startup project like ASP.Net WEB API. In this case you need to run the tool on every single project manually. E.g.
try-convert -w .\<your-project-name>.csproj
And for the API project just create a new project targeting .Net Core and move all your controllers and other code there. The startup project is always most complicated for migration so it's not that easy to do it automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With