Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:08:01+00:00 2026-06-05T10:08:01+00:00

C# CSC.exe If we give it a C# file, a .CS , is it

  • 0

C# CSC.exe

If we give it a C# file, a .CS , is it able to compile it and say for example a “;” is missing at line 12 of your code? In a form that later in my program – which is Java RCP app, I can show those compile errors in a Spreadsheet

How about MSBuild? Is that able to show compile errors same as my previous example?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:08:05+00:00Added an answer on June 5, 2026 at 10:08 am

    Say this is your code (program.cs):

    namespace MyCustomBuild
    {
         class Program
         {
             static void Main(string[] args)
             {
                 System.Console.WriteLine("Hello World")
             }
         }
    }
    

    You can call csc program.cs and receive the following output

    Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    program.cs(7,52): error CS1002: ; expected
    

    Alternatively you can use msbuild to achieve the exact same result! Here is the content of build.msbuild

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <Target Name="Default">
         <Csc Sources="program.cs"/> 
      </Target>
    </Project>
    

    You can then call your msbuild file with varying levels of verbosity, as shown.

    msbuild build.msbuild /verbosity:quiet and msbuild build.msbuild /verbosity:minimal

    Microsoft (R) Build Engine Version 4.0.30319.1
    [Microsoft .NET Framework, Version 4.0.30319.269]
    Copyright (C) Microsoft Corporation 2007. All rights reserved.
    
    program.cs(7,52): error CS1002: ; expected [<filePath>\build.msbuild]
    

    msbuild build.msbuild /verbosity:normal:

    Microsoft (R) Build Engine Version 4.0.30319.1
    [Microsoft .NET Framework, Version 4.0.30319.269]
    Copyright (C) Microsoft Corporation 2007. All rights reserved.
    
    Build started 6/6/2012 12:13:00 PM.
    Project "<filePath>\build.msbuild" on node 1 (default targets).
    Default:
      C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /out:program.exe program.cs
    program.cs(7,52): error CS1002: ; expected [<filePath>\build.msbuild]
    Done Building Project "<filePath>\build.msbuild" (default targets) -- FAILED.
    
    Build FAILED.
    
    "<filePath>\build.msbuild" (default target) (1) ->
    (Default target) -> 
      program.cs(7,52): error CS1002: ; expected ["<filePath>\build.msbuild]
    
        0 Warning(s)
        1 Error(s)
    
    Time Elapsed 00:00:00.28
    

    The remaining two verbosity levels are detailed and diagnostic and they present even more information if you want it. I’m not sure how much information you want for your spreadsheet, but hopefully one of these works for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example when you introduce an static class in your source code, csc compiler
In the .NET compiler (csc.exe) I can use the option /target:exe to compile into
I'm testing swig, and I found that SWIG's vcxproj file runs the mt.exe to
Where is the .NET command line compiler (csc.exe) located after install? I'm trying to
It's not difficult for me to save code to temp folder, use csc.exe to
With this simple C# code, I run csc hello.cs; ildasm /out=hello.txt hello.exe . class
I have a WinForm app. I compile it, double-click on it. Predictably, csc.exe kicks
I'm trying to compile a cs file that is in a sibling directory of
Does the Microsoft C# compiler (CSC.exe) have an option to output the Intermediate Language
Is there some way to compile (with the CSC task) a WPF Application with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.