尽管在另一种情况下使用完全相同的输入,但AzureBlobStorageContainer fetchattributes()抛出错误

发布于 2025-02-09 20:33:10 字数 542 浏览 1 评论 0原文

我有三个项目。一个是.NET框架网站,一个是.NET 6网站。这两个网站都使用运行.NET框架的第三个项目将文件上传到我们的Azure Blob存储中。

从.NET 6网站提交的文件丢失以下错误。来自.NET Framework网站的文件不会引发此错误。

System.IO.FileNotFoundException: Could not load file or assembly System.Data.Services.Client, Version=3.5.0.0

我已经从两个网站开始结束了上传。他们提供相同的信息。我检查了途中每个变量的值,没有差异。 唯一的差异是一个网站使用.NET 6,另一个网站使用.NET框架。但这没关系,因为两个网站都为第三个项目提供相同的信息。

当我们在第三个项目中初始化容器时,在AzureBlobStorageProvider对象上调用.fetchattributes()时,会抛出错误。

我完全损失了从这里去的地方,并感谢任何建议。我无法理解两个相同的输入如何引起两个不同的结果。

I have three projects. One is a .NET Framework website and one is a .NET 6 website. Both of these websites are using the 3rd project running .NET Framework to upload files onto our Azure blob storage.

Files submitted from the .NET 6 website throw the following error. Files from the .NET Framework website do not throw this error.

System.IO.FileNotFoundException: Could not load file or assembly System.Data.Services.Client, Version=3.5.0.0

I have stepped through the upload beginning to end from both websites. They provide identical information. I checked the value of every single variable along the way and there are no differences. The only difference is that one website is using .NET 6 and the other is using .NET Framework. But that shouldn't matter as both websites are providing identical information to the 3rd project.

The error is thrown when we call .FetchAttributes() on a AzureBlobStorageProvider object while initializing the container in the 3rd project.

I am at a total loss of where to go from here and would appreciate any suggestions. I cannot fathom how two identical inputs are causing two different outcomes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖上的星空 2025-02-16 20:33:10

您可以尝试以下几种解决方法:

解决方案1:

  1. 将Visual Studio更新为最新版本。

  2. 消除web.config

    中的所有绑定重定向

  3. 消除web.config

     < propertyGroup>
      < autogenateBindingRects> true</autogenerateBindingRedects> gt; gt; gt;
      < generateBindingReDirectSoutputType> true</generateBindingRedeRectSoutputType> gt; gt; gt;
    </propertyGroup>
    
     
  4. 构建项目。

  5. (webappname).dll.config文件应位于bin文件夹中。它应包含重定向;将它们复制到web.config文件。

  6. 从文件中删除以前的摘要.csproj

从文件.csproj 解决方案2:

尝试添加< usenetCoregenerator> true>/usenetCoregenerator> 。 CSPROJ 文件:

  <PropertyGroup>
    ...
    <UseNETCoreGenerator>true</UseNETCoreGenerator>
  </PropertyGroup>

注意:确保您使用的.NET 6与受支持的软件包版本,如果没有,请尝试更新。

参考:
https://github.com/azure.com/azure/azure/azure-functions--runctions-unctions-unctions-unctions-unctions-unctions-unctions-unctions-unctions-unctions-unctions-unctions-azure-functions- vs-Build-SDK/essess/160

Here are few workarounds that you can try:

Solution 1:

  1. Update the Visual Studio to the most recent version.

  2. Eliminate every binding redirect in web.config

  3. Include the following in the .csproj file:

    <PropertyGroup>
      <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
      <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
    </PropertyGroup>
    
    
  4. Build the project.

  5. The (WebAppName).dll.config file should be located in the bin folder. It should contain redirects; copy them to the web.config file.

  6. Delete the previous snippet from the file .csproj

Solution 2:

Try adding <UseNETCoreGenerator>true</UseNETCoreGenerator> to your .csproj file:

  <PropertyGroup>
    ...
    <UseNETCoreGenerator>true</UseNETCoreGenerator>
  </PropertyGroup>

Note: Make sure that you are using .net 6 with there supported package versions ,if not please try to update .

Reference:
https://github.com/Azure/azure-functions-vs-build-sdk/issues/160

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文