aspnet-codegenerator: Microsoft.VisualStudio.Web.CodeGeneration.Design eklendikten sonra bile kullanılabilir kod üreteci yok

Aug 26 2020

Aspnet-codegenerator kullanarak iskele oluşturulamıyor , aşağıda denediğim şey:

  1. Kullanılarak bir ASP.Net RazorPages uygulaması oluşturuldu dotnet new webapp

  2. Yaptı dotnet build

  3. Dotnet-aspnet-codegenerator kullanılarak yüklendi

    dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.4

  4. Koştu dotnet aspnet-codegenerator --help

    Yazıyor: Bu projede kod oluşturucu yok . Projeye NuGet paketi başvurusu olarak Microsoft.VisualStudio.Web.CodeGeneration.Design paketini ekleyin.

  5. 4. adımda belirtilen paketi kullanarak

    dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design

    Eklenen paket:

    <ItemGroup> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.4" /> </ItemGroup>

  6. Yine koştu: dotnet build

    Son adım

  7. Koştu dotnet aspnet-codegenerator --help

    Yine diyor ki: Bu projede hiçbir kod üreteci yok. Microsoft.VisualStudio.Web.CodeGeneration.Design paketini projeye NuGet paket başvurusu olarak ekleyin.

.Net çekirdek yüklü sürüm: 3.1.401

İşletim Sistemi: Ubuntu 20.04

Yanıtlar

1 Blondu Nov 21 2020 at 14:33

Bu zaten birkaç aylık, ancak son zamanlarda tüm projelerim için bununla karşılaştım.

Bu sayfaya başka birinin gelmesi durumunda, benim durumumdaki çözüm (MAC OS), dotnet-aspnet-codegenerator'ü kaldırıp yeniden yüklemekti.

Terminalde çalıştır:

dotnet tool uninstall --global dotnet-aspnet-codegenerator

dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.4
YiyiYou Aug 26 2020 at 13:10

Emrini test ediyorum ve bunu dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.4yaptığımda alabilirim

ve sonra sizinle Ran dotnet aspnet-codegenerator --helpaynı mesajı alıyorum No code generators are available in this project.Add Microsoft.VisualStudio.Web.CodeGeneration.Design package to the project as a NuGet, ancak aşağıdakileri yaptığımda mesaj olmadan koşabiliyorum:

Sanırım paket doğru eklenmemiş olabilir, kaldırıp tekrar eklemeyi deneyebilirsiniz.

dotnet remove package Microsoft.VisualStudio.Web.CodeGeneration.Design
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
Juanromeromarcano Dec 04 2020 at 10:34

Bu soruna ÇÖZÜM buldum:

En yeni sürümler bazı problemler veriyor, bu nedenle terminalde şu komutu yazarak sdk sürümünü 3.1.3'e düşürmeniz gerekecek :

sudo apt yükleme dotnet-sdk-3.1 = 3.1.301-1

Bundan sonra aşağıdakileri yüklemeniz gerekecek:

dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.3

Bundan sonra, bunu terminale yazarak doğru Web.CodeGeneration.Design Paketini eklemeniz gerekecektir:

sudo apt install dotnet-sdk-3.1 = 3.1.301-1 dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.3

Bu benim için çalıştı !!

RomanZ Dec 15 2020 at 19:31

.Net core 3.1.4'ten 5.0.1'e yükseltirken de aynı sorunu yaşıyorum.

Çözümüm:

  1. genel araçları güncelleyin:
  dotnet tool install --global dotnet-aspnet-codegenerator
  dotnet tool update --global dotnet-aspnet-codegenerator
  dotnet tool install --global dotnet-ef
  dotnet tool update --global dotnet-ef
  1. paketlere bağlantı ekle / güncelle
  dotnet remove package Microsoft.VisualStudio.Web.CodeGeneration.Design
  dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
  dotnet add package Add package Microsoft.EntityFrameworkCore.Design
  1. Dizesini değiştirin netcoreapp3.1.4için net5.0.csproj ve launch.json dosyalarında
  2. Dizinleri temizle
    • çöp Kutusu
    • obj
  3. Yeniden inşa projesi
  4. Sonunda çalıştırın:
  dotnet aspnet-codegenerator --help

Her şey yolunda giderse, mevcut jeneratörleri gösterecektir.