gpt4 book ai didi

azure - 无法将 "WindowsAzure.Storage"依赖项添加到 .Net Core (ASP.NET 5) 类库

转载 作者:行者123 更新时间:2023-12-04 17:17:07 25 4
gpt4 key购买 nike

我的项目解决方案是这样设置的,包含以下项目

MyProjectSolution.sln
MyProject.WebPI(Asp.net 5 WebAPI)
MyProject.Data(Asp.net 5 class libray)
MyProject.Domain(Asp.net 5 class libray)

我按照以下文章中列出的步骤进行操作 https://azure.microsoft.com/en-us/documentation/articles/vs-azure-tools-connected-services-storage/https://azure.microsoft.com/en-us/documentation/articles/vs-storage-aspnet5-getting-started-blobs/这更改了我的project.json以包含此依赖项 "WindowsAzure.Storage": "4.3.2-preview"

但随后出现错误,指出 DNXCoreVersion=5.0 不支持 WindowsAzure.Storage

注意:1)我还尝试手动添加上述依赖项以检查它是否导致相同或不同的错误 - 没有变化。

2) 我尝试浏览到 sdks 的位置 %Program Files%\Microsoft SDKs\Azure.NET SDK\\ref\但找不到它。附件是我找到的 dll 的屏幕截图。

有我可以尝试的特定版本吗?或者我在这里遗漏了一些重要的东西吗?

谢谢! enter image description here

{
"version": "1.0.0-*",
"description": "MyProject.Data Class Library",
"authors": [""],
"tags": [""],
"projectUrl": "",
"licenseUrl": "",

"frameworks": {
"dnx451": {
/*These were added after I connected to the Azure Storage as seen in the article that did NOT exist before*/
"dependencies": {
"Microsoft.Data.Edm": "5.6.3",
"Microsoft.Data.OData": "5.6.3",
"Microsoft.Data.Services.Client": "5.6.3",
"System.Spatial": "5.6.3"
}
},
"dnxcore50": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Runtime": "4.0.21-beta-23516",
"System.Threading": "4.0.11-beta-23516",
"System.IO": "4.0.11-beta-23516"
}
}
},
"dependencies": {
"MyProject.Domain": "1.0.0-*",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
/*This was added after I connected to the Azure Storage as seen in the article that did not exist before*/
"WindowsAzure.Storage": "4.3.2-preview",
}
}

最佳答案

使用7.0.2-预览版

https://www.nuget.org/packages/WindowsAzure.Storage/7.0.2-preview

根据变更日志,已更新为使用 .Net Core 1.0 的 RC2 版本。

7.1.1-preview 已针对 .Net Core 1.0 的 RTM 版本进行了更新,但目前似乎无法通过 NuGet 获得。 (NuGet page 表示“所有者已取消列出此包。这可能意味着该包已被弃用或不应再使用。”​​)

另请注意,这包含对 ODataLib 包的依赖项,目前没有 .Net Core 版本。请参阅this note for WindowsAzure.Storage readme其中指出:

The ODataLib packages currently do not support "netstandard1.6" or "netcoreapp1.0" frameworks in projects depending on the current relase of Dotnet CoreCLR. Thus, you may encounter failures while trying to restore the ODataLib dependencies for one of the targeted frameworks mentioned above. Until the support is added, if you run into this, you can use the imports statement within the framework node of your project.json file to specify to NuGet that it can restore the packages targeting the framework within the "imports" statement as shown below:

   "imports": [
"dnxcore50",
"portable-net451+win8"
]

编辑:使用 WindowsAzure.Storage 7.1.3-预览版

关于azure - 无法将 "WindowsAzure.Storage"依赖项添加到 .Net Core (ASP.NET 5) 类库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36210500/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com