✅ how do i publish my .NET project?
so i made this chess thingy (do check it out, i spent a month on it) and I want to publish it online so i can primarily use it in my other projects.
how exactly do i go about this? i'm using vscode btw - vs runs like shit and doesn't correct my code properly. command line would be preferred.
41 Replies
dotnet publish
where does it get published to?
and how can i use it in my own projects?
It publishes where you want it to
And you use it by typing
dotnet publish
in the terminal and pressing enterdotnet publish command - .NET CLI
The dotnet publish command publishes a .NET project or solution to a directory.
bit of a vague answer. are the platforms listed in the docs?
Everything is listed in the docs
alright thanks angius
Oh I didn't read vscode, sorry
with vscode you publish/build the app with the dotnet publish command, which you can run in the terminal like this
dotnet publish
without any arguments will just publish every project or solution in the directorythen for distributing online any file host works, but you could upload a build to the
Releases
tab of your github repowhat does this mean
ah ok makes sense
wait so run
dotnet publish
then it spits out a compiled exe and associated files?Yes
then add that as a release
ok got it
how would i use it as a package tho?
Wym as a package?
So that someone else can install it as a library in their own project?
like how in your
.csproj
file you can have <IncludePackage>...<IncludePackage/>
yeah
more specifically me
i wanna try adding a GUI for itAh, well, then you're looking for something else
dotnet publish
creates the executable
For packaging a library you use nuget
dotnet pack
produces a nuget packagedotnet pack command - .NET CLI
The dotnet pack command creates NuGet packages for your .NET project.
Then, you can upload that package to nuget.org, reference it as-is, place it in some folder and set it as one of nuget sources, or upload it to a Github nuget feed
Or any other nuget feed, really
whats a nuget feed?
A registry of nuget packages
Where you download nuget packages from
ah ok
any links?
(i'm new to this so sorry if i'm bugging you over trivial things)
NuGet documentation
NuGet is the package manager for Microsoft development platforms including .NET. The NuGet client tools provide the ability to create and consume packages.
This section in particular
alright taking a look
does this look good?
Yeah
dotnet pack
will tell you if there are any issues, anything missingit says i have multiple project/solution files
i only have 1
(of each)
what
The tag isn't closed
alright i think its working now
oh what
you need a
Main()
entry point?
for what?No, you don't
Not for a package
Ah, well, assuming you didn't change it, the
OutputType
is set to Exe
And an executable needs an entry point
Just remove that linealright, removed it and everything ran smoothly
thanks angius
i'll let you know it goes tomorrow morning (11:26pm rn)
:Ok:
If this is a lib, id just publish it and upload to nuget.
🦜
hell yeah lets go
Axololly.Chess.MoveGenerator 1.0.0
This library features two classes, one for classical chess and another for Chess960, that enable you to play Chess and generate moves in a simple manner.
For more information, check the repository here - https://github.com/axololly/chess/tree/main
@Angius worked fine
thanks a ton