【发布时间】:2016-01-07 10:42:05
【问题描述】:
我正在尝试从 Windows 命令行编译项目“MyProjectName”。
这是代码:
PUSHD E:\
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /target:library Projects\MyProjectName /define:DEBUG /out:\Projects\MyProjectName\debug\MyProjectName.dll *.cs
我得到错误:
source file "Projects\MyProjectName" could not be found
source file "*.cs" could not be found
【问题讨论】:
-
我不认为 csc 编译器可以编译所有带有通配符的 .cs。而是您需要编译描述文件的 .proj 文件。
-
我猜你只是想要
Projects\MyProjectName\*.cs。但是为什么不将您的项目文件提供给 msbuild? -
@npocmaka:不,csc 绝对可以处理通配符。
-
@npocmaka:如果你在 reasonable shell 中运行它,shell 会用一系列文件替换通配符。通配符处理由 shell 完成。
-
考虑改用开发者命令提示符。这将准备好环境,因此您可以从项目目录中调用 csc。
标签: c# batch-file