我尝试使用NPM/Webpack/Vue.js创建一个ASP.NET核心MVC应用程序。我正在学习本教程:https://marczak.io/posts/netcore-vuejs/
在启动项目时,我得到了以下异常:
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中:
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
{
HotModuleReplacement = true
});似乎有些JSON文件格式错误?!但哪一个。我是国家预防机制和Webpack的新手。
如果你需要更多的信息,请告诉我。
发布于 2018-09-06 14:20:28
发现这个dotnet问题:https://github.com/dotnet/core/issues/1726
我在代理后面,需要禁用它(而我不能),或者在Program.cs的Main()方法中添加该行:
AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false);https://stackoverflow.com/questions/52205577
复制相似问题