首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UseWebpackDevMiddleware AggregateException

UseWebpackDevMiddleware AggregateException
EN

Stack Overflow用户
提问于 2018-09-06 13:47:56
回答 1查看 610关注 0票数 1

我尝试使用NPM/Webpack/Vue.js创建一个ASP.NET核心MVC应用程序。我正在学习本教程:https://marczak.io/posts/netcore-vuejs/

在启动项目时,我得到了以下异常:

代码语言:javascript
复制
An exception of type 'System.AggregateException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'One or more errors occurred.'
 Inner exceptions found, see $exception in variables window for more details.
 Innermost exception     Newtonsoft.Json.JsonReaderException : Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)

异常发生在配置方法中的Startup.cs中:

代码语言:javascript
复制
        app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
        {
            HotModuleReplacement = true
        });

似乎有些JSON文件格式错误?!但哪一个。我是国家预防机制和Webpack的新手。

如果你需要更多的信息,请告诉我。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-09-06 14:20:28

发现这个dotnet问题:https://github.com/dotnet/core/issues/1726

我在代理后面,需要禁用它(而我不能),或者在Program.cs的Main()方法中添加该行:

代码语言:javascript
复制
AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false);
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52205577

复制
相关文章

相似问题

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