简体   繁体   中英

How to compile ZipFile class (C#) in command line

Before I start describing my problem I wanna say I did everything what I supposed to do in order to make ZipFile class functional. I mean, my target framework is .Net 4.5, I added references ( System.IO.Compression.FileSystem.dll and System.IO.Compression.dll ).

I can build the project within the Visual Studio without problem, no error. BUT when I try to compile the project using Command line that's when it gets interesting. I get everytime a error "error CS0103: the name ZipFile class does not exist in the current context".

The command for compiling in the CMD is: csc /define:DEBUG /optimize /out:tbuild.exe *.cs

Does anybody come across similar or even the same problem and knows solution for it, please?

First off, +1 on the msbuild suggestion, or you could look at something like Fake

You specify the reference to System.IO.Compression.FileSystem.dll etc... in your visual studio project. Then you proceed to build your exe using only *.cs files. I think you should specify any references other than System.dll on the command line as well like this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM