在另一个位置生成.exe文件 [英] Generate .exe file at another location

查看:71
本文介绍了在另一个位置生成.exe文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,


我正在尝试从一个位置编译.cs文件,并在另一位置生成其.exe文件.编译已完成,但.exe文件未在所需位置生成.

在Windows命令提示符下

C:\ Windows \ Microsoft.NET \ Framework \ v3.5> csc"d:\ abc.cs"

这很好用.

但是,当我尝试在d或e驱动器上生成其.exe文件时,它不会生成.相反,我能够在运行csc编译器的同一目录中生成.exe文件,即 C:\ Windows \ Microsoft.NET \ Framework \ v3.5

我也尝试过

Dear Friends,


I''m trying to compile .cs file from one location and generate its .exe file at other location. Compilation is done but the .exe file is not generating at the desired location.

At windows command Prompt

C:\Windows\Microsoft.NET\Framework\v3.5>csc "d:\abc.cs"

this works fine.

But when i try to generate its .exe file at d or e drive it does not generate. Instead I''m able to generate .exe file in the same directory where from I''m running csc compiler i.e. C:\Windows\Microsoft.NET\Framework\v3.5

I have also tried

C:\Windows\Microsoft.NET\Framework\v3.5>abc /out:d:\


但它仍在 C:\ Windows \ Microsoft.NET \ Framework \ v3.5 位置而不是 d或e驱动器
上创建abc.exe文件
请指导我在这里可以做什么.


but it is still creating abc.exe file at the location C:\Windows\Microsoft.NET\Framework\v3.5 instead of d or e drive

Please guide me what can i do here.

推荐答案

对我来说
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /out:f:\temp\x.exe Test.cs  


运行正常,文件将在应有的位置创建.
咨询: http://msdn.microsoft.com/en-us/library/78f4aasd.aspx [^ ]


is working just fine, the file is created where it should be.
Consult: http://msdn.microsoft.com/en-us/library/78f4aasd.aspx[^]


我在这里找到了解决方法

语法:
I got the solution here

syntax:
csc /out:"<drive>:\<directory if any>\<filename>.exe" 
"<drive>:\<directory if any>\<filename>.cs"





csc /out:"e:\abc.exe" "d:\abc.cs"



但是,您可以更改.exe名称



However you can change the .exe name

csc /out:"e:\myFile.exe" "d:\abc.cs"




感谢大家花时间在此查询上.




Thanks to everyone to put your time on this query.


这篇关于在另一个位置生成.exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆