小编mde*_*ois的帖子

如何获得dotnet Core 1.0找到System.Net.Http?

我有一个dotnet核心1.0应用程序,并尝试进行Post调用,但我遇到System.Net.Http的问题.我正在使用VSCode在OSX中开发这个应用程序.

当它尝试执行Post调用时,我在控制台中收到以下错误:

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
      An unhandled exception has occurred: Could not load file or assembly 'System.Net.Http, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Run Code Online (Sandbox Code Playgroud)

我在依赖项列表末尾的project.json文件中添加了以下行,并在dotnet restore之后调用:

    "System.Net.Http": "4.1.0"
Run Code Online (Sandbox Code Playgroud)

这些是我的使用陈述:

using System;
using …
Run Code Online (Sandbox Code Playgroud)

dotnet-httpclient asp.net-core

5
推荐指数
0
解决办法
1230
查看次数

grunt-contrib-watch导致超出最大调用堆栈大小

当我执行clean任务(grunt clean)时,一切都按预期工作,但是当我运行监视任务(grunt test)时,我收到以下错误:

util.js:35
  var str = String(f).replace(formatRegExp, function(x) {
                  ^
RangeError: Maximum call stack size exceeded
Run Code Online (Sandbox Code Playgroud)

这是我的gruntfile

module.exports = (grunt) ->

  grunt.initConfig
    pkg: grunt.file.readJSON('package.json')

    clean: ['tmpDir/']

    watch:
      options:
        spawn: false
      src:
        tasks: ['clean']
        files: [
          src: 'client/assets/strings/en/str.coffee'
        ]

  # plugins
  grunt.loadNpmTasks('grunt-contrib-clean')
  grunt.loadNpmTasks('grunt-contrib-watch')

  # tasks
  grunt.registerTask('test', ['watch'])
Run Code Online (Sandbox Code Playgroud)

这是我的package.json文件:

{
  "author": "Your Name <Your Email>",
  "name": "app-name",
  "description": "Application description",
  "version": "0.0.1",
  "homepage": "",
  "repository": {
    "type": "git",
    "url": ""
  },
  "engines": {
    "node": "~0.10.28"
  },
  "scripts": {
    "start": "muffin server" …
Run Code Online (Sandbox Code Playgroud)

gruntjs grunt-contrib-watch

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