Debugging TS断点在VS 2017升级到Angular 6后不起作用

Debugging TS断点在VS 2017升级到Angular 6后不起作用,debugging,visual-studio-2017,angular6,Debugging,Visual Studio 2017,Angular6,我目前使用的是Angular 6、.NET core 2.1,VS 2017。在升级到Angular 6之前,我使用的是Angular 4。TS文件中的断点工作正常。我已经升级到Angular 6,之后所有TS断点都不起作用 在断点上获取以下提示 当前不会命中断点。没有为此文档加载任何符号。 这是我的packages.json文件: "scripts": {}, "devDependencies": { "@angular/animations": "6.1.0", "@angular/cli"

我目前使用的是Angular 6、.NET core 2.1,VS 2017。在升级到Angular 6之前,我使用的是Angular 4。TS文件中的断点工作正常。我已经升级到Angular 6,之后所有TS断点都不起作用

在断点上获取以下提示

当前不会命中断点。没有为此文档加载任何符号。

这是我的packages.json文件:

"scripts": {},
"devDependencies": {
"@angular/animations": "6.1.0",
"@angular/cli": "^6.1.1",
"@angular/common": "6.1.0",
"@angular/compiler": "6.1.0",
"@angular/compiler-cli": "6.1.0",
"@angular/core": "6.1.0",
"@angular/forms": "6.1.0",
"@angular/http": "6.1.0",
"@angular/platform-browser": "6.1.0",
"@angular/platform-browser-dynamic": "6.1.0",
"@angular/platform-server": "6.1.0",
"@angular/router": "6.1.0",
"@ngtools/webpack": "^6.1.1",
"@types/chai": "4.1.4",
"@types/jasmine": "2.8.8",
"@types/webpack-env": "1.13.6",
"angular2-router-loader": "0.3.5",
"angular2-template-loader": "0.6.2",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^3.0.0",
"awesome-typescript-loader": "5.2.0",
"bootstrap": "4.1.3",
"chai": "4.1.2",
"css": "2.2.3",
"css-loader": "1.0.0",
"es6-shim": "0.35.3",
"event-source-polyfill": "0.0.12",
"expose-loader": "0.7.5",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.11",
"html-loader": "0.5.5",
"isomorphic-fetch": "2.2.1",
"jasmine-core": "3.1.0",
"jquery": "3.3.1",
"json-loader": "0.5.7",
"karma": "2.0.5",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-jasmine": "1.1.2",
"karma-webpack": "3.0.0",
"popper.js": "^1.12.9",
"preboot": "6.0.0-beta.4",
"raw-loader": "0.5.1",
"reflect-metadata": "0.1.12",
"rxjs": "6.2.2",
"style-loader": "0.21.0",
"to-string-loader": "1.1.5",
"typescript": "2.9.2",
"url-loader": "1.0.1",
"webpack": "^4.16.3",
"webpack-cli": "^3.1.0",
"webpack-hot-middleware": "2.22.3",
"webpack-merge": "4.1.3",
"zone.js": "0.8.26"
  },
  "dependencies": {
"ng-bootstrap": "^1.6.3",
"ngx-loading": "^1.0.14",
"ngx-pagination": "^3.1.1",
"npm": "^6.2.0",
"w3-css": "^4.1.0"
  }
这是我的网页配置文件

const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const AotPlugin = require('@ngtools/webpack').AotPlugin;
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;

module.exports = (env) => {
// Configuration in common to both client-side and server-side bundles
const isDevBuild = !(env && env.prod);
const sharedConfig = {
    stats: { modules: false },
    context: __dirname,
    resolve: { extensions: ['.js', '.ts'] },
    output: {
        filename: '[name].js',
        publicPath: 'dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix
    },
    module: {
        rules: [
            { test: /\.ts$/, use: isDevBuild ? ['awesome-typescript-loader?silent=true', 'angular2-template-loader', 'angular2-router-loader'] : '@ngtools/webpack' },
            { test: /\.html$/, use: 'html-loader?minimize=false' },
            { test: /\.css$/, use: ['to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize'] },
            { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }
        ]
    },
    mode:'development',
    plugins: [new CheckerPlugin(),
    new webpack.ContextReplacementPlugin(
        /angular(\\|\/)core/,
        path.resolve(__dirname, './ClientApp')
    )]
    //,
    //performance: {
    //    maxEntrypointSize: 512000,
    //    maxAssetSize: 512000
    //}
};

// Configuration for client-side bundle suitable for running in browsers
const clientBundleOutputDir = './wwwroot/dist';
const clientBundleConfig = merge(sharedConfig, {
    entry: { 'main-client': './ClientApp/boot.browser.ts' },
    output: { path: path.join(__dirname, clientBundleOutputDir) },
    plugins: [
        new webpack.DllReferencePlugin({
            context: __dirname,
            manifest: require('./wwwroot/dist/vendor-manifest.json')
        })
    ].concat(isDevBuild ? [
        // Plugins that apply in development builds only
        new webpack.SourceMapDevToolPlugin({
            filename: '[file].map', // Remove this line if you prefer inline source maps
            moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk
        })
    ] : [
            // Plugins that apply in production builds only
            new webpack.optimize.UglifyJsPlugin(),
            new AotPlugin({
                tsConfigPath: './tsconfig.json',
                entryModule: path.join(__dirname, 'ClientApp/app/app.browser.module#AppModule'),
                exclude: ['./**/*.server.ts']
            })
        ])
});

// Configuration for server-side (prerendering) bundle suitable for running in Node
const serverBundleConfig = merge(sharedConfig, {
    resolve: { mainFields: ['main'] },
    entry: { 'main-server': './ClientApp/boot.server.ts' },
    plugins: [
        new webpack.DllReferencePlugin({
            context: __dirname,
            manifest: require('./ClientApp/dist/vendor-manifest.json'),
            sourceType: 'commonjs2',
            name: './vendor'
        })
    ].concat(isDevBuild ? [] : [
        // Plugins that apply in production builds only
        new AotPlugin({
            tsConfigPath: './tsconfig.json',
            entryModule: path.join(__dirname, 'ClientApp/app/app.server.module#AppModule'),
            exclude: ['./**/*.browser.ts']
        })
    ]),
    output: {
        libraryTarget: 'commonjs',
        path: path.join(__dirname, './ClientApp/dist')
    },
    target: 'node',
    devtool: 'inline-source-map'
});

return [clientBundleConfig, serverBundleConfig];
};
帮我解决这个问题

TS断点在VS 2017升级到Angular 6后不起作用

这是.NET core 2.1的一个已知问题,许多其他社区在开发者社区上报告了该问题:

微软开发团队已经在VisualStudio的最新15.9预览版中修复了这个问题。您可以从以下URL()下载最新预览

同时,他们建议开发人员在创建新项目时以.NET core SDK 2.0为目标,并在项目创建后将项目目标运行时更新为2.1


希望这有帮助。

尝试删除sln文件附近的vs文件夹。还要确保调试选项设置正确,并且启用了Javascript调试。我对chrome也有类似的问题,但在IE中它运行良好。升级VS2017后,在运行我的网站时,它问我是否要启用java脚本调试。单击yes之后,我就可以在chrome中调试了。我猜vs中有一些设置必须启用chrome ja调试

我已经下载了预览版本,并尝试进行调试。但我仍然面临同样的问题。我也在那个帖子上发表了我的评论。甚至我也尝试过这种变通方法,但没有用。我不知道它是否与这里相关,因为我不使用Visual Studio。但在Intellij&Visual Studio代码的情况下,是Angular CLI中的网页包配置导致了问题。