Question
How can I build a .exe file from a .cs code file using MIKE Core SDK Release 2026?
Answer
MIKE Core SDK Release 2026 makes use of dotNet 8.0. This is new compared to the earlier MIKE Core SDK releases, hence the build statement is different for Release 2026 compare to earlier releases.
#1 Prerequisites
The user needs to install DotNet 8.0 on the PC (this can be downloaded from Download .NET 8.0 (Linux, macOS, and Windows) | .NET)
#2 Build process
The build process will be such that a generic project file (.csproj) needs to be placed in a separate folder with the specific .cs file and used for the build.
A: The project file (.csproj) should be created with the following contents:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<Reference Include="DHI.Generic.MikeZero.DFS">
<HintPath>C:\Program Files (x86)\DHI\MIKE Core SDK\2026\bin\x64\DHI.Generic.MikeZero.DFS.dll</HintPath>
</Reference>
<Reference Include="DHI.Mike.Install">
<HintPath>C:\Windows\Microsoft.NET\assembly\GAC_MSIL\DHI.Mike.Install\v4.0_1.0.0.0__c513450b5d0bf0bf\DHI.Mike.Install.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
The file is generic for all cs-files, but the version must match the installed MIKE Core SDK version (indicated by yellow).
B: The build command looks as follows (from the folder with the .csproj file and .cs file):
Dotnet build CropDfsuFile.csproj
The .csproj file will build an exe-file based on the only .cs file in the folder. The name of the .csproj file will define the name of the .exe file.
(In this example the .cs file in the folder is also named CropDfsuFile.cs, but it is not necessary that the .cs file is named the same as the .csproj file).
C: The resulting exe file will be created and located in a subfolder (./bin/Debug/net8.0) along with the assemblies necessary to run the exe file. E.g. for CropDfsuFile the folder will contain the following:
#3 Execution
It is now possible to use the tool from a Dos-prompt by including the path to the .exe file in the folder. E.g. from the folder that contains the dfsu file ‘Run_DecouplingFlux.dfsu’ that needs to be cropped to the first 110 time steps and saved in the new file ‘New_DecouplingFlux.dfsu’:
C:\Data\MyOwnTools\CropDfsuFile\CropDfsuFile.exe Run_DecouplingFlux.dfsu New_DecouplingFlux.dfsu 110
For older versions of MIKE Core SDK the build statement is different. Pls. see KA-01226 for the build of the same exe file in Release 2025.
FURTHER INFORMATION & USEFUL LINKS
[Manuals and User Guides]
MIKE Core SDK Documentation Index
[Release Notes]
MIKE Core SDK Release Note


