-2

Is there a way to compile c# code w/in SharpDevelop (also applies to visual studio)? I am currently using DOS to do it, which seems inefficient.

EDIT: In other words, how do I do the equivalent of 'c:\windows\microsoft.net\framework\v2.0.50727\csc.exe /target:library /reference:ExcelDna.Integration.dll TestLib.cs' in sharp develop?

usr951
  • 73
  • 1
  • 6
  • What are you asking? Of _course_ it's possible to compile code! You can't really be asking that. – John Saunders Dec 01 '11 at 02:28
  • re-read the question. that's not what I'm asking – usr951 Dec 01 '11 at 02:28
  • Your question either makes no sense, or is mind-bogglingly basic. – Andrew Barber Dec 01 '11 at 02:29
  • Re-state the question. What are you asking? – John Saunders Dec 01 '11 at 02:30
  • You create a new empty project, you add your .cs files to it, right click, build. If this is really what you are asking, you are making fun of us... – yms Dec 01 '11 at 02:37
  • sorry for the confusion. It's building an .exe file. I am looking to build a .dll file. Can I do that in Sharp Develop? I apologize, I am VERY new to c# and developing w/ VS and Sharp Develop – usr951 Dec 01 '11 at 02:46
  • In Visual Studio, you would use the "Build" command from the "Build" menu. Maybe it's the same in SharpDevelop? – John Saunders Dec 01 '11 at 02:55
  • why the down votes? if no one can answer this it seems like a valid question, no? – usr951 Dec 01 '11 at 03:37
  • The downvotes are happening because the question is mindnumbling basic. As has already been stated, "Your question either makes no sense, or is mind-bogglingly basic." – Andrew Barber –  Dec 01 '11 at 03:39
  • 1
    So, basic questions are not allowed on this board? What is wrong with asking something I don't understand. I've seen a lot of newbie questions on this board before w/out being down voted – usr951 Dec 01 '11 at 12:33
  • Basic questions are fine, but you should have included "I want to do a dll instead of exe" in the question/title. Asking "How to compile" when there is a big fat "BUILD" button in visual studio makes it look like you didn't do your research. The DLL/EXE question is actually a good one that many newbies would miss. – BradleyDotNET Jun 13 '14 at 21:46

1 Answers1

4

Let me count the ways (in Visual Studio - in SharpDevelop I bet you can look under the Build menu)

  1. Use the Build Menu and select Build Solution
  2. Hit F6
  3. Debug->Start Debugging (automatically will build first)
  4. Hit F5
  5. Right Click on Solution in Solution Explorer and select Build Solution
  6. Right click on project in Solution exploer and select Build Project.

and I'm sure there are more...

I do remember a long time ago I used to look for a way to actually compile a single file but then I quit looking. The syntax checker is so good (especially with ReSharper) that its not necessary, and the build process tends to be extremely fast.

EDIT --see comment Here's a screenshot of the popup you can use to change a project from a Windows Application to a Class Library. If you are in a file from the project you can also get to this view by selecting the last item from the Project menu (it has your project name and the suffix Properties...) enter image description here

Tod
  • 8,192
  • 5
  • 52
  • 93
  • how do I get it to compile a .dll file? It keeps building a .exe file – usr951 Dec 01 '11 at 03:17
  • 2
    In Visual Studio when you start a new project you would need to pick one of the library options. In C# a typical choice is the Class Library. I've never done it after the fact but you can try right clicking the project and selecting Properties. Then on the Application tab you will see an *Output type* popup. Change it from Windows Application to Class Library. – Tod Dec 01 '11 at 03:45
  • @Tod Disagree with the typical choice. The output type purely depends on what your assembly be. – abhilash Dec 01 '11 at 05:07
  • 1
    According to MW's "typical" means "exhibits the essential characteristics of a group". I stand by my statement that a Class Library is a typical .dll. – Tod Dec 01 '11 at 18:50