Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 由于index.d.ts中出现错误,无法编译我的Web应用程序_C#_Asp.net Mvc - Fatal编程技术网

C# 由于index.d.ts中出现错误,无法编译我的Web应用程序

C# 由于index.d.ts中出现错误,无法编译我的Web应用程序,c#,asp.net-mvc,C#,Asp.net Mvc,三天前我离开了一些代码,它工作得非常好。今天下午,我登录查看此错误: Build:Type '"button" | "view" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | "char" | "charCode" | ... 13 more ... | "to

三天前我离开了一些代码,它工作得非常好。今天下午,我登录查看此错误:

Build:Type '"button" | "view" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | "char" | "charCode" | ... 13 more ... | "touches"' does not satisfy the constraint '"button" | "code" | "view" | "y" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | "char" | ... 54 more ... | "DOM_KEY_LOCATION_STANDARD"'. Exemptions  C:\Users\bh05164\node_modules\@types\jquery\index.d.ts  8155    

当我双击该错误时,我得到以下文本行:

interface Event<TTarget = EventTarget,
        TData = null> extends Partial<Pick<PointerEvent & KeyboardEvent & TouchEvent, 'altKey' | 'bubbles' | 'cancelable' |
        'changedTouches' | 'ctrlKey' | 'detail' | 'eventPhase' | 'metaKey' | 'pageX' | 'pageY' | 'shiftKey' | 'view' |
        'char' | 'charCode' | 'key' | 'keyCode' | 'button' | 'buttons' | 'clientX' | 'clientY' | 'offsetX' | 'offsetY' |
        'pointerId' | 'pointerType' | 'screenX' | 'screenY' | 'targetTouches' | 'toElement' | 'touches'>> {
接口事件扩展了部分{
…并突出显示“altKey”

我的代码没有任何变化,我从谷歌得到的最好答案是“更新类型脚本”。我已经安装了最新版本,但没有变化


如何消除此错误?

至少在本例中,解决方案是完全删除我的代码,然后从BitBucket重新下载


现在一切正常。不知道它为什么会坏。

至少在这种情况下,解决方案是完全删除我的代码,然后从BitBucket重新下载

现在一切正常。不知道它为什么会坏。

jquery.d.ts中的Visual Studio生成错误TS2344
  • 安装Nuget软件包版本3.5.3-必须为版本3.5.3或更低

  • Visual Studio市场:

    • 安装
    • 更新csproj文件,并更改以下设置
  • 
    ...
    ...
    3.5
    
    jquery.d.ts中的Visual Studio生成错误TS2344
  • 安装Nuget软件包版本3.5.3-必须为版本3.5.3或更低

  • Visual Studio市场:

    • 安装
    • 更新csproj文件,并更改以下设置
  • 
    ...
    ...
    3.5
    
    每当我看到这条消息时,它都与不正确的index.d.ts文件有关

    在我的package.json中,我定义了几个明确类型的开发人员依赖项

    {
        "version": "1.0.0",
        "name": "asp.net",
        "private": true,
        "devDependencies": {
            "@types/kendo-ui": "2018.2.4",
            "@types/jqueryui": "1.12.7"
        }
    }
    
    我不知道,剑道ui类型文件有一个 然而,KendoUI2018.2.4创建时所依据的JQuery类型定义并没有被纳入到我的项目中

    由于依赖项刚刚指定了JQuery,它将获取最新版本的JQuery DefinitelyTyped文件并在我的项目中使用。此文件与kendo ui 2018.2.4不兼容,因此会导致错误:

    Build:Type '"button" | "view" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | "char" | "charCode" | ... 13 more ... | "touches"' does not satisfy the constraint '"button" | "code" | "view" | "y" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | "char" | ... 54 more ... | "DOM_KEY_LOCATION_STANDARD"'.
    
    您可以通过检查拉入节点\u模块文件夹的文件来验证这一点

    为了解决这个错误,我必须将我的剑道ui版本升级到一个与最新JQuery违抗类型版本兼容的版本

    {
        "version": "1.0.0",
        "name": "asp.net",
        "private": true,
        "devDependencies": {
            "@types/kendo-ui": "2019.2.0",
            "@types/jqueryui": "1.12.7"
        }
    }
    

    在阅读GitHub问题后,我偶然发现了这个解决方案。

    每当我看到这条消息时,它都与不正确的index.d.ts文件有关

    在我的package.json中,我定义了几个明确类型的开发人员依赖项

    {
        "version": "1.0.0",
        "name": "asp.net",
        "private": true,
        "devDependencies": {
            "@types/kendo-ui": "2018.2.4",
            "@types/jqueryui": "1.12.7"
        }
    }
    
    我不知道,剑道ui类型文件有一个 然而,KendoUI2018.2.4创建时所依据的JQuery类型定义并没有被纳入到我的项目中

    由于依赖项刚刚指定了JQuery,它将获取最新版本的JQuery DefinitelyTyped文件并在我的项目中使用。此文件与kendo ui 2018.2.4不兼容,因此会导致错误:

    Build:Type '"button" | "view" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | "char" | "charCode" | ... 13 more ... | "touches"' does not satisfy the constraint '"button" | "code" | "view" | "y" | "altKey" | "bubbles" | "cancelable" | "changedTouches" | "ctrlKey" | "detail" | "eventPhase" | "metaKey" | "pageX" | "pageY" | "shiftKey" | "char" | ... 54 more ... | "DOM_KEY_LOCATION_STANDARD"'.
    
    您可以通过检查拉入节点\u模块文件夹的文件来验证这一点

    为了解决这个错误,我必须将我的剑道ui版本升级到一个与最新JQuery违抗类型版本兼容的版本

    {
        "version": "1.0.0",
        "name": "asp.net",
        "private": true,
        "devDependencies": {
            "@types/kendo-ui": "2019.2.0",
            "@types/jqueryui": "1.12.7"
        }
    }
    
    在阅读GitHub问题后,我偶然发现了这个解决方案