centos7-安装dotnet工具

centos7-安装dotnet工具

1. centos7-安装dotnet工具

  • 安装epel源

    [root@sonarqube config]# yum install epel-release -y
    
  • 导入dotnet源

    [root@sonarqube config]# rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
    
  • 查找dotnet安装包

    [root@sonarqube config]# yum search dotnet-sdk
    已加载插件:fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.bupt.edu.cn
     * epel: mirrors.tuna.tsinghua.edu.cn
     * extras: mirrors.bupt.edu.cn
     * updates: mirrors.tuna.tsinghua.edu.cn
    ====================================================================== N/S matched: dotnet-sdk ======================================================================
    dotnet-sdk-2.0.0.x86_64 : Microsoft .NET Core SDK - 2.0.0 2.0.0
    dotnet-sdk-2.0.2.x86_64 : Microsoft .NET Core SDK - 2.0.2 2.0.2
    dotnet-sdk-2.0.3.x86_64 : Microsoft .NET Core SDK - 2.0.3 2.0.3
    dotnet-sdk-2.1.x86_64 : Microsoft .NET Core SDK 2.1.818 2.1.818
    dotnet-sdk-2.1.101.x86_64 : Microsoft .NET Core SDK - 2.1.101 2.1.101
    dotnet-sdk-2.1.103.x86_64 : Microsoft .NET Core SDK - 2.1.103 2.1.103
    dotnet-sdk-2.1.104.x86_64 : Microsoft .NET Core SDK - 2.1.104 2.1.104
    dotnet-sdk-2.1.105.x86_64 : Microsoft .NET Core SDK - 2.1.105 2.1.105
    dotnet-sdk-2.1.2.x86_64 : Microsoft .NET Core SDK - 2.1.2 2.1.2
    dotnet-sdk-2.1.200.x86_64 : Microsoft .NET Core SDK - 2.1.200 2.1.200
    dotnet-sdk-2.1.201.x86_64 : Microsoft .NET Core SDK - 2.1.201 2.1.201
    dotnet-sdk-2.1.202.x86_64 : Microsoft .NET Core SDK - 2.1.202 2.1.202
    dotnet-sdk-2.1.3.x86_64 : Microsoft .NET Core SDK - 2.1.3 2.1.3
    dotnet-sdk-2.1.300-preview2-008530.x86_64 : Microsoft .NET Core SDK 2.1.300 - Preview 2.1.300-preview2-008530
    dotnet-sdk-2.1.300-preview2-008533.x86_64 : Microsoft .NET Core SDK 2.1.300 - Preview 2.1.300-preview2-008533
    dotnet-sdk-2.1.300-rc1-008673.x86_64 : Microsoft .NET Core SDK 2.1.300 - rc1 2.1.300-rc1-008673
    dotnet-sdk-2.1.4.x86_64 : Microsoft .NET Core SDK - 2.1.4 2.1.4
    dotnet-sdk-2.2.x86_64 : Microsoft .NET Core SDK 2.2.402 2.2.402
    dotnet-sdk-3.0.x86_64 : Microsoft .NET Core SDK 3.0.103 3.0.103
    dotnet-sdk-3.1.x86_64 : Microsoft .NET Core SDK 3.1.416 3.1.416
    dotnet-sdk-5.0.x86_64 : Microsoft .NET SDK 5.0.405 5.0.405
    dotnet-sdk-6.0.x86_64 : Microsoft .NET SDK 6.0.102 6.0.102
    
      名称和简介匹配 only,使用“search all”试试。
    
  • 安装最新dotnet

    [root@sonarqube config]# yum -y install dotnet-sdk-6.0
    
  • 验证安装是否成功

    [root@sonarqube config]# dotnet --version
    6.0.102
    

2. dotnet build报错

  • 问题描述: linux下dotnet build 时候出现 .1.201/NuGet.targets(124,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json.

  • 解决方案

    • 解决: /etc/pki/tls/certs/ 下面少了证书 ca-certificates.crt 拷贝下面内容到证书里面

      -----BEGIN CERTIFICATE-----
      MIIGKjCCBRKgAwIBAgIQAqQdLHDmymcvfOktofoYODANBgkqhkiG9w0BAQsFADBE
      MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMR4wHAYDVQQDExVE
      aWdpQ2VydCBHbG9iYWwgQ0EgRzIwHhcNMjAwNTI2MDAwMDAwWhcNMjEwNDIxMTIw
      MDAwWjBqMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE
      BxMHU2VhdHRsZTEZMBcGA1UEChMQQW1hem9uLmNvbSwgSW5jLjEZMBcGA1UEAwwQ
      Ki5jbG91ZGZyb250Lm5ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
      ALjmEtiriUa4qnrqn/2cr9G1V1k5OHmOCbmiV1o3fOV6hh0WlkMnxSWwZymiHVBs
      UJT5hwbzCZA/ZzpQEbR+R9i2tG+dQZjtrTLOT3eQFf+vnsMPQaxxtrRKpOXFBb+k
      I6v7NMc4BSbeIBdborf6oNOlZTwxf6FrYgPRkrx4jYKws3+7L99JEFd9qrh1EUh9
      N+L5tdXSmEKB0TuGCqIDurX4Qr3BmfXLRSMBW+s+aCjPLISUQqpWuEUb1JP9PsXG
      Lq/RhDBUc5kz5ce/unhsn4Gofae0CC28/B3dG990JSuIXV1QWH//7MKq4h5ccRVm
      CAf1Eqsn9LiCVzo2ph9wkGMCAwEAAaOCAvAwggLsMB8GA1UdIwQYMBaAFCRuKy3Q
      apJRUSVpAaqaR6aJ50AgMB0GA1UdDgQWBBT9CHxeVWKeVgPyHN6Kr/Y6Nlq+YDAr
      BgNVHREEJDAigg5jbG91ZGZyb250Lm5ldIIQKi5jbG91ZGZyb250Lm5ldDAOBgNV
      HQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMHcGA1Ud
      HwRwMG4wNaAzoDGGL2h0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEds
      b2JhbENBRzIuY3JsMDWgM6Axhi9odHRwOi8vY3JsNC5kaWdpY2VydC5jb20vRGln
      aUNlcnRHbG9iYWxDQUcyLmNybDBMBgNVHSAERTBDMDcGCWCGSAGG/WwBATAqMCgG
      CCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5jb20vQ1BTMAgGBmeBDAEC
      AjB0BggrBgEFBQcBAQRoMGYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2lj
      ZXJ0LmNvbTA+BggrBgEFBQcwAoYyaHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29t
      L0RpZ2lDZXJ0R2xvYmFsQ0FHMi5jcnQwCQYDVR0TBAIwADCCAQQGCisGAQQB1nkC
      BAIEgfUEgfIA8AB2APZclC/RdzAiFFQYCDCUVo7jTRMZM7/fDC8gC8xO8WTjAAAB
      clNLl6UAAAQDAEcwRQIhAMYtqUXSgf3an/P4pBi0TS98I2C1arlRiJw4Gzb4qfId
      AiAA4vzevJEIKUaGCIlbYtRFPpHdOXa3puSu1NI4UOnH0AB2AFzcQ5L+5qtFRLFe
      mtRW5hA3+9X6R9yhc5SyXub2xw7KAAABclNLl6AAAAQDAEcwRQIgNWyRH7MiefJl
      lVPPOjbXrN6h9LGpLt1GDZb/G9qTTugCIQDu7ZM3uhLbRGd+CaRf1mZsewK4Yx+2
      v5FTlbb51v1FLTANBgkqhkiG9w0BAQsFAAOCAQEAtUBM7I/pNffuawE5VE71d/96
      7zLVGq8n0nEsrR5cLKRUUmAe0HH0idccnZoL1qycRdIf3LswGP0ir+uPJSafDXBG
      vatJiWBYARvjeGkg2dfYauMMzfNhMsQxA5xNLLAuJ4a+tMUsBgML0GvFp6rq+qgz
      DycX0AwVpE3HtOWk5/Erp9zwKX4CwLqyF37jImelVPMIRD7mkIe073AB9K3ukfl7
      tEXQABQmgl/GQ4nmTCyXZCuEQLV6zEgWfdNNylXFagzjTFf9XJykWcLoPcKBk8dm
      BJKWgyA5r7J1/zNYfZYc4rD4u1bMt2uINeLUjsahTLqrj3UaYWj4Zpj/wNuU0A==
      -----END CERTIFICATE-----
      -----BEGIN CERTIFICATE-----
      MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBh
      MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
      d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
      MjAeFw0xMzA4MDExMjAwMDBaFw0yODA4MDExMjAwMDBaMEQxCzAJBgNVBAYTAlVT
      MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxHjAcBgNVBAMTFURpZ2lDZXJ0IEdsb2Jh
      bCBDQSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANNIfL7zBYZd
      W9UvhU5L4IatFaxhz1uvPmoKR/uadpFgC4przc/cV35gmAvkVNlW7SHMArZagV+X
      au4CLyMnuG3UsOcGAngLH1ypmTb+u6wbBfpXzYEQQGfWMItYNdSWYb7QjHqXnxr5
      IuYUL6nG6AEfq/gmD6yOTSwyOR2Bm40cZbIc22GoiS9g5+vCShjEbyrpEJIJ7RfR
      ACvmfe8EiRROM6GyD5eHn7OgzS+8LOy4g2gxPR/VSpAQGQuBldYpdlH5NnbQtwl6
      OErXb4y/E3w57bqukPyV93t4CTZedJMeJfD/1K2uaGvG/w/VNfFVbkhJ+Pi474j4
      8V4Rd6rfArMCAwEAAaOCAVowggFWMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0P
      AQH/BAQDAgGGMDQGCCsGAQUFBwEBBCgwJjAkBggrBgEFBQcwAYYYaHR0cDovL29j
      c3AuZGlnaWNlcnQuY29tMHsGA1UdHwR0MHIwN6A1oDOGMWh0dHA6Ly9jcmw0LmRp
      Z2ljZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RHMi5jcmwwN6A1oDOGMWh0dHA6
      Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RHMi5jcmwwPQYD
      VR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vd3d3LmRpZ2lj
      ZXJ0LmNvbS9DUFMwHQYDVR0OBBYEFCRuKy3QapJRUSVpAaqaR6aJ50AgMB8GA1Ud
      IwQYMBaAFE4iVCAYlebjbuYP+vq5Eu0GF485MA0GCSqGSIb3DQEBCwUAA4IBAQAL
      OYSR+ZfrqoGvhOlaOJL84mxZvzbIRacxAxHhBsCsMsdaVSnaT0AC9aHesO3ewPj2
      dZ12uYf+QYB6z13jAMZbAuabeGLJ3LhimnftiQjXS8X9Q9ViIyfEBFltcT8jW+rZ
      8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4co
      atc7TlJFGa8kBpJIERqLrqwYElesA8u49L3KJg6nwd3jM+/AVTANlVlOnAM2BvjA
      jxSZnE0qnsHhfTuvcqdFuhOWKU4Z0BqYBvQ3lBetoxi6PrABDJXWKTUgNX31EGDk
      92hiHuwZ4STyhxGs6QiA
      -----END CERTIFICATE-----
      -----BEGIN CERTIFICATE-----
      MIIE3zCCA8egAwIBAgIQYxgNOPuAl3ip0DWjFhj4QDANBgkqhkiG9w0BAQsFADCB
      yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
      ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp
      U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW
      ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0
      aG9yaXR5IC0gRzUwHhcNMTcxMTA2MDAwMDAwWhcNMjIxMTA1MjM1OTU5WjBhMQsw
      CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu
      ZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjCC
      ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALs3zTTce2vJsmiQrUp1/0a6
      IQoIjfUZVMn7iNvzrvI6iZE8euarBhprz6wt6F4JJES6Ypp+1qOofuBUdSAFrFC3
      nGMabDDc2h8Zsdce3v3X4MuUgzeu7B9DTt17LNK9LqUv5Km4rTrUmaS2JembawBg
      kmD/TyFJGPdnkKthBpyP8rrptOmSMmu181foXRvNjB2rlQSVSfM1LZbjSW3dd+P7
      SUu0rFUHqY+Vs7Qju0xtRfD2qbKVMLT9TFWMJ0pXFHyCnc1zktMWSgYMjFDRjx4J
      vheh5iHK/YPlELyDpQrEZyj2cxQUPUZ2w4cUiSE0Ta8PRQymSaG6u5zFsTODKYUC
      AwEAAaOCAScwggEjMB0GA1UdDgQWBBROIlQgGJXm427mD/r6uRLtBhePOTAPBgNV
      HRMBAf8EBTADAQH/MF8GA1UdIARYMFYwVAYEVR0gADBMMCMGCCsGAQUFBwIBFhdo
      dHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcCAjAZDBdodHRwczovL2Qu
      c3ltY2IuY29tL3JwYTAvBgNVHR8EKDAmMCSgIqAghh5odHRwOi8vcy5zeW1jYi5j
      b20vcGNhMy1nNS5jcmwwDgYDVR0PAQH/BAQDAgGGMC4GCCsGAQUFBwEBBCIwIDAe
      BggrBgEFBQcwAYYSaHR0cDovL3Muc3ltY2QuY29tMB8GA1UdIwQYMBaAFH/TZafC
      3ey78DAJ80M5+gKvMzEzMA0GCSqGSIb3DQEBCwUAA4IBAQBQ3dNWKSUBip6n5X1N
      ua8bjKLSJzXlnescavPECMpFBlIIKH2mc6mL2Xr/wkSIBDrsqAO3sBcmoJN+n8V3
      0O5JelrtEAFYSyRDXfu78ZlHn6kvV5/jPUFECEM/hdN0x8WdLpGjJMqfs0EG5qHj
      +UaxpucWD445wea4zlK7hUR+MA8fq0Yd1HEKj4c8TcgaQIHMa4KHr448cQ69e3CP
      ECRhRNg+RAKT2I7SlaVzLvaB/8yym2oMCEsoqiRT8dbXg35aKEYmmzn3O/mnB7bG
      Ud/EUrkIf7FVamgYZd1fSzQeg1cHqf0ja6eHpvq2bTl+cWFHaq/84KlHe5Rh0Csm
      pZzn
      -----END CERTIFICATE-----
      
      

推荐这些技术文章:

解决The SDK 'Microsoft.NET.Sdk' specified could not be found.

来源:https://github.com/dotnet/msbuild/issues/2532#issuecomment-335794563
我通过创建一个值为“C:\Program Files\dotnet\sdk\2.0.0\Sdks”的路径变量“MSBuildSDKsPath”解决了这个问题
我不知道为什么 msbuild 默认找不到此路径,但这为我们解决了问题

...

VS2022安装后,使用VS2019打开项目,出现无法找到.NET SDK的问题解决

  VS2022出来后,开始安装了此版本。但是安装好了后,只用VS2019打开之前的项目,部分文件加载失败,出现如下的问题,我通过下面的方式解决了
    
 
   使用cmd打开,执行dotnet --info 命令,出现如下的问题
    
 
   打开环境变量,找到如下的配置
    
 
   删除上面x86的环境变量配置,然后点击确...

在 Ubuntu 上安装 .NET SDK 或 .NET

链接:在 Ubuntu 上安装 .NET - .NET | Microsoft Docs

...

VS2019打开项目加载失败:无法找到 .NET Core SDK。请检查确保已安装此项且 global.json 中指定的版本(如有)与所安装的版本相匹配

.NET Core项目。
因为要在本地发布项目,发布时需要安装dotnet-hosting-5.0.3-win.exe,安装iis。发布好后发现项目加载失败,报错:VS2019打开项目加载失败:无法找到 .NET Core SDK。请检查确保已安装此项且 global.json 中指定的版本(如有)与所安装的版本相匹配。

 
 本地是有sdk的,重新安装仍然报这个错误。
最...

文章标题:centos7-安装dotnet工具
文章链接:https://www.dianjilingqu.com/51584.html
本文章来源于网络,版权归原作者所有,如果本站文章侵犯了您的权益,请联系我们删除,联系邮箱:saisai#email.cn,感谢支持理解。
THE END
< <上一篇
下一篇>>