首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VS2022安装程序:由于System.Numerics和/或Newtonsoft.Json.Utilities.ConvertUtils异常而无法安装/修复

VS2022安装程序:由于System.Numerics和/或Newtonsoft.Json.Utilities.ConvertUtils异常而无法安装/修复
EN

Stack Overflow用户
提问于 2022-07-15 12:35:35
回答 1查看 38关注 0票数 0

这个问题始于今天(或最近)一个.NET 4.7.2项目,该项目在我的Win10, VS2022 Enterprise机器上停止运行,抱怨缺少或不匹配的System.Numerics库版本。自动绑定重定向已经启用。

当我启动VS安装程序时,什么都没有出现(既没有安装,也没有可用)。然而,VS2022仍然运行正常。我越想解决问题,事情就越糟。我已经浪费了几个小时试图重新安装、重新安装、修复、从添加/删除程序中卸载、使用installcleanup.exe手动卸载、重命名安装程序文件夹、从GAC中删除所有程序集等等。

为了简短起见,安装程序安装过程中出现的错误如下:

无法获得更新安装程序

日志中的错误总是相同的:

代码语言:javascript
复制
VisualStudio Bootstrapper:15/07/2022 14:09:48: Caught Exception: Type = TypeInitializationException,
    Message = The type initializer for 'Newtonsoft.Json.Utilities.ConvertUtils' threw an exception.,
    StackTrace =    at Newtonsoft.Json.Utilities.ConvertUtils.GetTypeCode(Type t, Boolean& isEnum)
   at Newtonsoft.Json.Serialization.DefaultContractResolver.IsJsonPrimitiveType(Type t)
   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)
   at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Microsoft.VisualStudio.Setup.Utility.JsonUtility.ParseNameValuePairJson(String jsonContents)
   at Microsoft.VisualStudio.Setup.Utility.JsonUtility.ParseNameValuePairJsonFile(IServiceProvider services, String filePath)
   at Microsoft.VisualStudio.Setup.Bootstrapper.Program.Parse(String[] args, IServiceProvider serviceProvider, IC2RSignatureReaderInterop c2rSignatureReader, String entryAssemblyProcessName, String entryAssemblyProcessFullName)
InnerException:Type = FileNotFoundException,
    Message = Could not load file or assembly 'System.Numerics, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.,
    StackTrace =    at Newtonsoft.Json.Utilities.ConvertUtils..cctor()

注意:我已经查了很多这个问题,所以请不要提出明显的广泛引用的解决方案,比如“添加/删除程序”或“修复按钮”。另外,我可以通过重命名安装程序文件夹启动的安装程序窗口上的“报告问题”按钮不起作用。通过命令行进行脱机安装也不起作用。

是否有人已经经历过这个问题,除了重新安装整个操作系统之外,还可以提出其他解决方案?由于这个异常,安装程序似乎无法解析某些temp/boostraper.json文件,但我不知道如何解决这个问题。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-20 16:51:46

结果我确实删除了一个GAC,但这不是GAC (至少不是唯一的)。基于另一个答案和MS论坛,从GAC*中删除每个C:\Windows\assembly\文件夹似乎已经做到了这一点。“另一个”在AppData文件夹中的某个地方。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72994091

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档