title | source_url | category | version | tags | description | ||||
---|---|---|---|---|---|---|---|---|---|
How to create a new class for source code |
Development |
v6.0 |
|
This article describes how to create a new class for containing custom source code. |
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.
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.
- 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).
- Add the following references:
- SenseNet.ContentRepository.dll
- SenseNet.Portal.dll
- SenseNet.Storage.dll
- System.Web.dll
- 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.
There are not external references for this article.