Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 2.07 KB

how-to-create-a-new-class-for-source-code.md

File metadata and controls

31 lines (26 loc) · 2.07 KB
title source_url category version tags description
How to create a new class for source code
Development
v6.0
howto
developers
enterprise
community
This article describes how to create a new class for containing custom source code.

Steps

In order to have your code running in sensenet you will have to place the compiled code in the bin folder. There are two ways to achieve this.

Option 1: Add new class in the web application

If you have not yet already set up your development environment please read How to set up development environment. Open the web application that is set up as the IIS site for your sensenet installation (MyWebApplication) and add a new class to the Code folder (see section Create Code and Root folders in How to set up development environment). Since your code will be part of the running web application, rebuilding your web application is adequate to have your compiled code running in the bin folder.

Please note, that for creating console application and other external tools you will need to create separate projects and not use the web application referred in How to set up development environment.

Option 2: Add new class in a separate project

  1. Create a new class library in Visual Studio 2010 to an arbitrary location and add a new class (if Visual Studio has not yet added one automatically).
  2. Add the following references:
    • SenseNet.ContentRepository.dll
    • SenseNet.Portal.dll
    • SenseNet.Storage.dll
    • System.Web.dll
  3. After producing your code, compile the project and copy dll-s into the web folder's bin folder.

Although option 2 will work fine and might be easier to start off with, the recommended way is option 1.

Related links

References

There are not external references for this article.