Compile CSharp using Nemerle - vilinski/nemerle GitHub Wiki

It is possible to compile C# source files using Nemerle compiler.

Follow these steps:

1. Add this in the beginning of .csproj file:

<PropertyGroup>
  <NoStdLib>true</NoStdLib>
  <Nemerle Condition=" '$(Nemerle)' == '' ">$(ProgramFiles)\Nemerle</Nemerle>
  <Name>ClassLibrary1</Name>
</PropertyGroup>

2. Add references to the Nemerle.dll and the Nemerle.Linq.dll:

<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core">
  <RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="Nemerle">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>$(Nemerle)\Nemerle.dll</HintPath>
  <Private>True</Private>
</Reference>
<MacroReference Include="Nemerle.Linq">
  <HintPath>$(Nemerle)\Nemerle.Linq.dll</HintPath>
</MacroReference>

3. Replace this:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

With this:

<Import Project="$(Nemerle)\Nemerle.MSBuild.targets" />

4. That's all !

Attention: C# files will be compiled using Nemerle semantics. It may affect on behavior in some cases.

⚠️ **GitHub.com Fallback** ⚠️