This chapter will explain how to start using SharpKit in new or existing projects, SharpKit easily integrates into any project type, whether it's a web application, class library or even console application.
SharpKit enabled ASP.NET web application will be created with an aspx page, and a C# code-behind with a class that is converted to JavaScript during compilation.
Add the following line on your .csproj file: (add it right after all 'Import' sections in your project file)
<!--This line is in any .csproj file: --> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!--Add this line after all Import sections: --> <Import Project="$(MSBuildBinPath)\SharpKit\4\SharpKit.Build.targets" />
Add the following references into your project:
SharpKit supports any C# type project, including web, console (.exe) and class library (.dll) project types.
Edit your .csproj file, replace the SharpKit v2 import line, with the SharpKit v4 import line:
<!--Replace this line:--> <Import Project="$(MSBuildBinPath)\SharpKit\SharpKit.Build.targets" /> <!--With this line:--> <Import Project="$(MSBuildBinPath)\SharpKit\4\SharpKit.Build.targets" />
Update assembly references, make sure to update SharpKit.JavaScript.dll, never reference both assemblies. SharpKit v4 assemblies are located in your Program Files\SharpKit\4\ folder.
Edit your .csproj file, replace the SharpKit v4 import line, with the SharpKit v5 import line:
<!--Replace this line:--> <Import Project="$(MSBuildBinPath)\SharpKit\4\SharpKit.Build.targets" /> <!--With this line:--> <Import Project="$(MSBuildBinPath)\SharpKit\5\SharpKit.Build.targets" />