Avatar ·

tsconfig.json错误:构建时未在配置文件中找到输入文件 — 如何修复?

大家好!我是TypeScript新手,正在使用Visual Studio 2015和ASP.NET Core。我创建了一个项目,在根目录添加了`tsconfig.json`文件,但编译时出现错误: > Build: No inputs were found in config file. Specify 'include' or 'files' property, or remove 'rootDir' to allow all files in the 'src' folder to be used. 这是我的`tsconfig.json`: ```json { "compilerOptions": { "target": "es5", "module": "commonjs", "rootDir": "src", "outDir": "dist", "strict": true } } ``` 在`src`文件夹中我有一个`app.ts`文件: ```typescript function greet(name: string): string { return `Hello, ${name}!`; } console.log(greet("World")); ``` 但TypeScript没有找到这个文件。我尝试过重启IDE、删除并重新创建`tsconfig.json`,但都没有用。请告诉我哪里做错了?为什么编译器找不到输入文件,尽管它们就在`src`文件夹中?提前感谢! <<>>

错误原因

错误在于