<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Elton Alves on Medium]]></title>
        <description><![CDATA[Stories by Elton Alves on Medium]]></description>
        <link>https://medium.com/@alveselton?source=rss-230831a41eb3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*WS3XSVKVFYX8emWA</url>
            <title>Stories by Elton Alves on Medium</title>
            <link>https://medium.com/@alveselton?source=rss-230831a41eb3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:44:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alveselton/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Principais comandos — NET CLI]]></title>
            <link>https://medium.com/@alveselton/principais-comandos-net-cli-ef615210edcd?source=rss-230831a41eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef615210edcd</guid>
            <category><![CDATA[net-core]]></category>
            <category><![CDATA[net-core-5]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[Elton Alves]]></dc:creator>
            <pubDate>Mon, 04 Oct 2021 21:47:31 GMT</pubDate>
            <atom:updated>2021-10-04T21:47:31.957Z</atom:updated>
            <content:encoded><![CDATA[<h3>Principais comandos — NET CLI</h3><p>Olá Pessoal! Querendo usar a ferramenta de linha de comando do <strong>NET CLI</strong>?<br>Confira algumas dicas que deixarei abaixo.</p><p>Certifique-se de ter baixado o SDK .Net CORE.<br>Segue o link, caso você não tenha baixado: <a href="https://dotnet.microsoft.com/download">https://dotnet.microsoft.com/download</a></p><p><strong>Estrutura do comando</strong><br>Driver + opções e argumentos do comando</p><p><strong>Exemplo</strong><br>dotnet new mvc<br>dotnet build<br>dotnet restore<br>dotnet run</p><p>Utilize a ferramenta <strong>Prompt de Comando</strong>, <strong>PowerShell </strong>e etc</p><blockquote>Comandos básicos<br><strong>new<br>restore<br>build<br>publish<br>run<br>test<br>clean<br>sln<br>help<br>pack<br>migrate<br>store<br>vtest</strong></blockquote><blockquote>Comandos de modificação de projetos<br><strong>add package<br>add reference<br>remove package<br>remove reference<br>list reference</strong></blockquote><blockquote>Comandos avançados<br><strong>nuget delete<br>nuget locals<br>nuget push<br>msbuild<br>dotnet install script</strong></blockquote><blockquote>Obter Ajuda<br><strong>dotnet --help<br>dotnet &lt;comand&gt; --help</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*5RYTLv6lvOENCOB5jbW1sQ.jpeg" /><figcaption><strong>Imagem 01</strong></figcaption></figure><h3><strong>Criando um novo Projeto</strong></h3><p>// Exibe todos os tipos de projetos<br><strong>dotnet new</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*VIzCLYm-WBLSKaleEqqFSA.jpeg" /><figcaption><strong>Imagem 02</strong></figcaption></figure><p>// Cria um projeto na pasta atual com nome da pasta atual<br><strong>dotnet new [template]</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*24mnO5JSfIPBixE2Fhu_NA.jpeg" /><figcaption><strong>Imagem 03</strong> - O <strong>console </strong>foi o template utilizado na imagem</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*4QzJxqDDBoJ17m60yzu8rA.jpeg" /><figcaption><strong>Imagem 04</strong> - Estrutura do projeto template <strong>console</strong> criado</figcaption></figure><p>// Cria um projeto na pasta “Pasta” com o nome “Projeto”<br><strong>dotnet new [template] -o &lt;nome-da-pasta&gt; --name &lt;nome-do-projeto&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*MjHbj1SYrvGEJa8mJkYpWA.jpeg" /><figcaption><strong>Imagem 05</strong> - Projeto sendo criado dentro de uma pasta e um nome específico</figcaption></figure><h3><strong>Executar e construir (build) solutions</strong></h3><p>// Comandos<br><strong>dotnet restore<br>dotnet clean<br>dotnet build<br>dotnet run</strong></p><p><strong>Observação</strong>: Para executar estes comandos é necessário que esteja dentro da pasta que contém o arquivo com extensão <strong>.csproj</strong> ou mencionar a <strong>pasta e o nome do arquivo com a extensão .csproj</strong></p><p>// Especificar projeto de destino<br><strong>dotnet [command] <br>dotnet [command] --project [pasta-projeto]/[nome-projeto].csproj</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*2s3fPPlb4GIRBIiqQzCUsQ.jpeg" /><figcaption><strong>Imagem 06</strong> - executando o dotnet run dentro da pasta que contém o arquivo .csproj</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*1OalqSrKBWf2a9LYRJm0Lw.jpeg" /><figcaption><strong>Imagem 07</strong> - Executando o projeto a partir da pasta acima</figcaption></figure><h3><strong>Criando arquivos de solução</strong></h3><p>Criando uma nova Solution</p><p>// Usa o nome da pasta atual<br><strong>dotnet new sln</strong></p><p>// Cria a solução na pasta com o nome indicado<br><strong>dotnet new sln -o &lt;Pasta&gt;</strong></p><p>// Especifica o nome da solução na pasta atual<br><strong>dotnet new sln --name Nome-Solucao</strong></p><p>// Especifica o nome da solução na pasta com o nome indicado<br><strong>dotnet new sln -o &lt;nome-da-pasta-do-projeto&gt; --name Nome-Solucao</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*ezTTNV8-Whc1aSoNHjymDw.jpeg" /><figcaption><strong>Imagem 08</strong> - Adicionando o arquivo da solução no projeto</figcaption></figure><p><strong>Observação</strong>: A solução foi criada, porém o projeto não foi incluído na solução.</p><p>Vamos adicionar os projetos a solução. Para isso, eu criei uma nova pasta com o projeto <strong>Exemplo01</strong>, <strong>Exemplo02 </strong>e adicionei o arquivo da solução (<strong>SolucaoExemplo01.sln</strong>), conforme imagem 09</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*RaZBKXU7YN4uLCB33NGdHQ.jpeg" /><figcaption><strong>Imagem 09</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*qg8VdncOQ8jaz_7CuLuhMg.jpeg" /><figcaption><strong>Imagem 10 </strong>- Arquivo da solução aberto no <strong>VS Code</strong>. Não existe referência aos projetos</figcaption></figure><p>// Adicionar um projeto na solução<br><strong>dotnet sln [arquivo-solucao].sln add [arquivo-projeto].csproj<br>dotnet sln [arquivo-solucao].sln add &lt;caminho&gt;/[arquivo-projeto].csproj &lt;caminho&gt;/[arquivo-projeto2].csproj</strong></p><p>// Remover um projeto na solução<br><strong>dotnet sln [arquivo-solucao].sln remove [arquivo-projeto].csproj<br>dotnet sln [arquivo-solucao].sln remove &lt;caminho&gt;/[arquivo-projeto].csproj &lt;caminho&gt;/[arquivo-projeto2].csproj</strong></p><p>// Exibe todos os projetos na solution<br><strong>dotnet sln [arquivo-solucao].sln list</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*vqa2j0r920VcmeaGUKzU9w.jpeg" /><figcaption><strong>Imagem 11</strong> - Adicionando os projetos na solução.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8e7n9fl2RijF21KEuoPYgg.jpeg" /><figcaption><strong>Imagem 12</strong> - Inclusão dos projetos na solução visto pelo VS Code</figcaption></figure><h3><strong>Compilando o projeto</strong></h3><p>// Compilando o projeto <br><strong>dotnet build</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*1YKtWD0SW5dDgMgZ-y2E8Q.jpeg" /><figcaption><strong>Imagem 13</strong> - Compilando o projeto</figcaption></figure><h3><strong>Gerenciando pacotes nuget no projeto</strong></h3><p>// Adicionando pacote<br><strong>dotnet add packge [nome-pacote]<br>dotnet add [nome-projeto].csproj package [nome-pacote]</strong></p><p>// Removendo o pacote<br><strong>dotnet remove packge [nome-pacote]<br>dotnet remove [nome-projeto].csproj package [nome-pacote]</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*CzoQ78MCvuBzqBX44Z6kgw.jpeg" /><figcaption><strong>Imagem 14</strong> - Instalação do pacote Newtonsoft.json</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*JPWhSexGLBay7EU-7V2RPA.jpeg" /><figcaption><strong>Imagem 15</strong> - Referência do pacote no projeto</figcaption></figure><p>E para finalizar… Vamos publicar nossa solução.</p><p>// Publicando o projeto<br><strong>dotnet publish</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*lo1ngVzn_bLzB7KPB9woyw.jpeg" /><figcaption><strong>Imagem 16</strong> - Publicando o projeto</figcaption></figure><p>Até a próxima!!</p><p>Referência: <a href="https://docs.microsoft.com/pt-br/dotnet/core/tools">https://docs.microsoft.com/pt-br/dotnet/core/tools</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef615210edcd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>