小编Sco*_*000的帖子

错误:无法加载文件或程序集网络标准,版本 = 2.1.0.0

我有一个 AzureFunctions 项目,我需要将它升级到 .NET 标准 2.1(从 2.0 开始)解决方案中的所有其他项目都加载并正确编译,但是这个 AzureFunctions 项目抛出了这个错误:

错误 System.IO.FileNotFoundException:无法加载文件或程序集“netstandard,版本=2.1.0.0,文化=中性,PublicKeyToken=cc7b13ffcd2ddd51”。该系统找不到指定的文件。文件名:'netstandard,版本=2.1.0.0,Culture=neutral,PublicKeyToken=cc7b13ffcd2ddd51'

我已经验证了所有 nuget 包都已更新,还有什么可能?

谢谢!

azure-functions .net-standard

8
推荐指数
2
解决办法
2万
查看次数

如何清除缓存的 angularjs 文件

我有一个基于 angularjs 的 Web 应用程序,其中一些功能已部署给我需要隐藏的用户。我已经添加了隐藏它的代码,并成功验证了控件在适当的时候是隐藏的,但仍然有用户拥有旧版本的文件并且可以执行不需要的活动。有没有办法可以从服务器控制视图文件在客户端刷新?(测试人员能够清除他们的缓存,但这对现场用户来说是一种负担)

谢谢!斯科特

html caching angularjs

1
推荐指数
1
解决办法
8075
查看次数

ASP.NET Core Data Protection 跨平台加密提供程序

我正在尝试将 asp.net 核心 DataProtectionProvider 与支持服务器场的单个数据库一起使用。我为商店实现了一个 IXmlRepository,我成功地向运行我的服务器的两台机器提供了相同的证书。我确认我正在以相同的顺序使用相同用途的字符串,但是当我尝试从机器 a 编码的机器 ba 字符串中取消保护时,我得到了一个通用的 CryptographicException。

如果机器 a 和机器 b 是 2 个不同的操作系统,这有关系吗?(Linux 与 Windows 服务器)

我得到的例外是:

{System.Security.Cryptography.CryptographicException:抛出了“System.Security.Cryptography.CryptographicException”类型的异常。在 Microsoft.AspNetCore.Cryptography.UnsafeNativeMethods.ThrowExceptionForBCryptStatusImpl(Int32 ntstatus) 在 Microsoft.AspNetCore.Cryptography.UnsafeNativeMethods.ThrowExceptionForBCryptStatus(Int32 ntstatus) 在 Microsoft.AspNetCore.DataProtection.Cng.Gcm. pbAdditionalAuthenticatedData, UInt32 cbAdditionalAuthenticatedData)
在 Microsoft.AspNetCore.DataProtection.Cng.Internal.CngAuthenticatedEncryptorBase.Decrypt(ArraySegment)1 ciphertext, ArraySegment1 个额外的 AuthenticatedData) 在 Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status) 在 Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector,[Dangerer , Boolean& wasRevoked) 在 Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData) 在 Microsoft.AspNetCore.DataProtection.DataProtectionCommonExtensions.Unprotect(IDataProtectorprotector, String protectedData)

.net encryption .net-core asp.net-core

1
推荐指数
1
解决办法
1425
查看次数

如何创建枚举标志的动态列表,然后传递给另一种方法

我有一个类似以下的场景,我有一个枚举,我得到了一些经过解析的文本,以创建一个枚举的列表,我想将其传递到ReportResults中,该列表将根据传递的标记来创建电子邮件。我没有访问以更改枚举或ReportResults方法,是否可以传递诸如resultFlags变量之类的内容?有没有一种方法可以使用Enum.TryParse创建要传递的单个项目?(在某些时候,序列化需要这样的东西)

    [Flags]
    public enum Result
    {
        None = 0,
        Warning = 2,
        Error = 4,
        Success = 8,
        Failure = 16
    }

    public void ProcessResultValues(string log)
    {
        var resultFlags = new List<Result>();

        /// Process log text, add Result flags to the resultFlags list

        ReportResults(resultFlags);
    }

    public void ReportResults(Result results)
    {
        /// Based on the flags, generate a text to describe if the process succeeded or failed and if there were any warnings or errors encountered during processing.
    }
Run Code Online (Sandbox Code Playgroud)

c# enums

1
推荐指数
1
解决办法
44
查看次数