Skip to content

csci-1301/C-Sharp-project-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C# Project Maker

This is a simple Makefile that creates C# projects compatible with any OS / IDE / .NET core versions (that we know of).

Testing the Project and the C# Project Maker

To test the C# project

  1. Grab the solution_name.zip file from our release,

  2. Extract solution_name.zip,

  3. Open solution_name/solution_name.sln with your favorite IDE,

  4. Make sure you can compile and execute Program.cs. Normally, the program should display

    10
    Hello from Class2
    

Please, open an issue if you cannot reproduce this behavior or if your IDE did not open correctly the project, or report to us if your OS / IDE / .Net version combination is not listed below.

To create the C# project

Pre-requisites

Alternatively, you can simply clone this repository and have github's action produce the project for you, using our workflow.

Creating a C# project and testing it

To run the example,

  1. (Download or clone this program.)

  2. Run

    make build/solution_name.zip
    
  3. Look into the build/ folder that was created for a solution_name.zip file.

  4. Extract solution_name.zip,

  5. Open solution_name/solution_name.sln with your favorite IDE,

  6. Make sure you can compile and execute Program.cs. Normally, the program should display

    10
    Hello from Class2
    

Please, open an issue if you cannot reproduce this behavior or if your IDE did not open correctly the project, or report to us if your OS / IDE / .Net version combination is not listed below.

Instructions to Create a New Project

To create a new project:

  • Create a folder in src/ and name it after the solution (say, sol-xx),

  • Create a folder in src/sol-xx and name it after the project (say, proj-yy),

  • Create a Program.cs file (mandatory), and, possibly, one (or multiple) class files (called, for instance, Class1.cs, Class2.cs, etc., except that you can't actually use those names).

  • Run

    make build/sol-xx.zip
    
  • Check that the file build/sol-xx.zip was correctly created and can be opened with your IDE.

Comments

The makefile is actually very simple, it creates the .sln, .csproj and .cs files to obtain this structure:

 └───<Solution>
      ├── <Solution.sln>
      └── <Project>
           ├── <Project>.csproj
           ├── Properties
           │   └── AssemblyInfo.cs
           ├── Program.cs           
           └── <Class>.cs	     (Optional, can be repeated)

This is for very simple projects (such as the ones used for pedagogical purposes in this introduction to programming course), with portability in mind.

Despite the following source and discussions:

there are no specification (that we know of) for C# projects, hence the need for this type of approach.

Tested on

We confirm that the solution created using this project work on the following:

OS IDE IDE Version .Net Core SDK Version .Net Core Runtime Version
Debian 12 MonoDevelop 7.8.4 8.0.10 8.0.0
Debian 12 JetBrains Rider 2023.3.2 8.0.10 8.0.0
MacOs Sonoma (14.1.1) Visual Studio for Mac 2022 7.0.308 7.0.11
Windows 11 Visual Studio 2022 - -
Windows 10 Entreprise (22h2) Visual Studio Entreprise 2019 5.0.302 5.0.8

Reporting Data

If your OS / IDE combination is not presented above, we would appreciate it if you could contact us or open a merge request adding your information. The command dotnet --info may give you the .Net Core SDK and .Net Core Runtime versions, if not please refer to https://learn.microsoft.com/en-us/dotnet/core/install/how-to-detect-installed-versions.

About

Simple resource to create C# projects compatible with any OS / IDE version

Resources

License

Stars

Watchers

Forks

Packages

No packages published