It is easier to establish and debug dnn module projects under the entire dotnetnuke (dnn) solution. You can also "go to definition" at any time to view the class content in the dnn framework, the only drawback is slowness! It takes several minutes to open and compile a dnn, and seven or eight minutes to debug a dnn. It may take 10 minutes to debug a dnn. Dizzy, time passes in waiting.
Creating a separate solution for the dnn module can save a lot of time. To establish a separate solution for module development, three problems need to be solved:
1. Where can I build a solution to help develop and test it?
2. How can I reference the original DLL and add the generated DLL to that directory?
3. How to debug it?
The order in which I create the dnn module development environment is as follows:
1. Create a module project
1. In dnnProgramCreate a dnn module project under the topmodules directory. The project name is the module name.
2. Rename the project name as "company name. Module name ". If your project name is "company name. Module name", skip this step. However, I do not like the name of the module folder as "company name. Module name ".
3. Reference The dotnetnuke. dll component in the "bin directory of the dnn program.
4. Configure project properties:
1) modify the Assembly name to "company name. modules. Module name"
2) import some default namespaces.Source codeUse the imports statement in the file to import the namespace used (I like to import it separately ).
3) set the project output path to "bin directory of dnn program", so that the compiled DLL file can be copied directly to the running directory to avoid manual copying every time.
5. Create the module control file ascx. Generally, there are three ascx files: Module name. ascx, edit module name. ascx, and settings. ascx. You cannot directly add a "User Control" to a project of the class library type. I copied it from another place and modified it. I hope to know a better method.
6. Create the app_globalresources directory under the Module Directory to store language resource files.
2. Create the sqldataprovider project related to the module (some modules do not need to access the database, so this step can be saved)
1. Create the sqldataprovider project of the dnn module under the providers \ dataproviders directory under the Module Directory. The project name is "sqldataprovider ".
2. Rename the project name as "company name. Module name. sqldataprovider ".
3. Reference The dotnetnuke. dll component and Microsoft. applicationblocks. Data. dll component in the "bin directory of the dnn program.
4. reference the corresponding module component "company name. modules. Module name. dll" in "bin directory of dnn program ". Note: here, you cannot directly reference a module project but need to reference the module components, mainly because referencing a module project will cause an error during generation. You can try to directly reference the module project to see if there is any problem.
5. Configure project properties:
1) modify the Assembly name to "company name. modules. Module name. sqldataprovider"
2) import some default namespaces.
3) set the project output path to "bin directory of dnn program ".
The problem persists: because the project is a referenced module component, you need to re-reference the module after the module project is re-compiled.
3. Set the runtime environment in dnn
1. log on using the host identity and add a new definition in "host Management --> module definition ".
2. Save and add related controls, such as view, edit, and set controls. For details about the keys and types used by each control, refer to the settings in other modules.
4. debug the program
One article Article There are detailed introduction: http://www.cnblogs.com/leeichang/archive/2004/11/16/64418.html
By default, Asp. net Process (for IIS 2000 and IIS 5.0 on Windows 5.1 and Windows XP are aspnet_wp.exe, for IIS 6 on Windows Server 2003 is w3wp.exe) as the ASPNET process. Therefore, to debug it, you must have the administrator privilege for the computer running ASP. NET.
In fact, we can also use the dnnjungle template to create a dnn module project. I tried it and it generated by default.CodeThe Code style is not the same as that of the built-in dnn module. I need to change many places so I didn't use it. If you are interested, try it. Welcome to share your trial experience!
Templates for dnnjungle URL: http://dnnjungle.vmasanas.net/Development/Templates/tabid/28/Default.aspx
More>