Missing page files in project - database

I have a situation where I have project which:
Contains 10 page files in project directory.
Contains 12 page in table Page in Access database.
I want to fix the project structure. What should I do?

If there are missing pages in project directory, there should be CenterDb rebuild done.
Steps:
Open the project.
Run rebuild of center database.
There would be message that will inform the user what pages are missing in project.
The next is to remove missing pages from project structure in explorer.
(or if user has access to missing pages, he should manually paste them in project directory)

Related

DNN Error after creating a module

I was given a project for maintenance, it is built on DNN 9.1.1 and has some custom modules (I am completely new to DNN). I needed to create a new module, so I used the christoc project templates for VS2017. So even before I could develop anything, I rebuilt the solution and it gave me a DNN Error. I removed the project from the solution, but while it compiles correctly, it still gives the same error.
Has anyone ever got this error? Do you think the module are being written to the database and if so, how can I delete it?
I'm posting the errors in the log but it doesn't make sense to me, because no files are missing
DotNetNuke.Services.Exceptions.Exceptions - DotNetNuke.Services.Exceptions.PageLoadException: Unhandled error loading page. ---> System.Web.HttpParseException: The file '/DesktopModules/GFIPortugal/DotNetNuke.Search.Google/GoogleSearch.ascx' does not exist. ---> System.Web.HttpParseException: The file '/DesktopModules/GFIPortugal/DotNetNuke.Search.Google/GoogleSearch.ascx' does not exist. ---> System.Web.HttpException: The file '/DesktopModules/GFIPortugal/DotNetNuke.Search.Google/GoogleSearch.ascx' does not exist.
Thanks in advance for your help.
I found that this is a common error. Funny how it was so hard to find on google. I leave the link here https://www.christoc.com/Tutorials/All-Tutorials/aid/12, and urge everyone with template errors to refer to this site.
In plain, the solution is this:
Load the IIS Manager (start>run>inetmgr.exe)
Expand the Tree view on the left side of the screen until you see the SITES folder
Expand the Sites folder until you find your development site
Expand your development site (DNNDEV.ME) until you see the DesktopModules folder
If the DesktopModules folder has an "arrow" on it, IIS thinks it is a virtual directory, and this is what causes the error above. Right click on the DesktopModules folder, choose Delete.
Reload the site in your web browser, and the error should go away. Do not simply refresh the browser, as the error is in the URL and will likely just reload the error page even though you've fixed the problem
Does the .ascx control exist in the correct path?
'/DesktopModules/GFIPortugal/DotNetNuke.Search.Google/GoogleSearch.ascx'
Maybe you have created an extra subfolder.
try like this:
'/DesktopModules/GFIPortugal/GoogleSearch.ascx'
When you add a new module via Visual Studio unselect the option to create a folder for your project/solution (bottom right of the Add New Project wizard).
Also, check the .dnn file to adjust the mappings of your resources.

Manually Create composite.generated.dll

I'm new to composite C1 CMS and am trying to update a site from 4.1 to 4.2.
I'm running into some build errors because the 4.2 generated.dll file doesn't know about the custom data types etc that were in the 4.1 generated.dll.
Do you have to create the generated.dll manually somehow?
The Composite.Generated.dll is usually regenerated when the website restarts.
The quickest way to fix it would be to:
put the old DLL back
start the site
restart the website in IIS
If the DLL isn't updated, there should be errors in the log files
Way #2:
Delete the /bin/Composite.Generated.dll
Temporary remove DLL-s and App_Code files that were referencing classes from Composite.Generated.dll
Start and restart the website
Check the log files for errors if the file wasn't re-created

Deployment of new pages from Local to Production

I've a copy of DotNetNuke website on my local machine in which I've added few pages and created new modules.
I've to move these new pages to production so have copied the pages to respective folders. I know there are few database entries that are also to be made on production database to recognize these pages and modules on production.
Please tell me how I can register these pages on production website
I searched on Google but may be I'm not getting the right keywords to search. Currently I've to restore my local db to production to run those pages. I'm using version 7 of DNN
This isn't something that DNN handles very well, publishing from a local environment to production.
The most common way (Besides backup/restore of the database) is to use page Templates. You can "Export" a page in DNN, that will generate an XML document with the modules and content referenced into the portals/#/ folder (where # is the portal id)
You can upload that file to your production site (same path) and then create a new page based on that page template.
Your question implies that you are creating .aspx files and copying those to the production server. That really isn't the way that DNN works, and you probably are creating a real mess.
How did you create the pages on your local site? Did you use the DNN functionality to create new pages, add modules to those pages, etc.? Or, did you do something else?
Use the built-in funtionality to create pages on your local installation and, as Chris
To add modules - Go to your web site in production, login as super user, and install the module, then go to the page in the web site and add it. The same as you would do with 3rd party module. This will properly add the info to db.
To add pages - You could do it within the code, using the
To create DNN page (the tab):
TabController tbc = new TabController();
//...populating the page's info
tbc.AddTab(destinationTabInfo);
To create ascx control as global (meaning doesn't belong to any module) ModuleControl.
var moduleControl = new ModuleControlInfo
{
... populate the fields
};
ModuleControlController.AddModuleControl(moduleControl);

Templateless Module Development

Throughout the internet documentation for DotNetNuke is far and wide, this in itself is quite useful. However one hurdle exist and I can't appear to solve it. How do you do DotNetNuke Module development without Chris Hammond's Template?
This template has become so widely accepted and utilizes that no other documentation exists.
I've already accomplished the following:
Configured SQL Server Database
Configured Internet Information System (Bindings)
Modified the System32 Host File (For local IP to reflect web-site Name)
Installed the MSBuild Community Task
Installed DotNetNuke Instance
Everything is installed and in place, now I have open DotNetNuke's Site into Visual Studio and configure my project to actually build the module.
I figured if I reference the .dll for DotNetNuke that should suffice, but the Web Forms Project loads all this extra garbage that impacts the development.
Could someone outline the proper way to build your environment from scratch without the template for Visual Studio?
Setup a DNN Development environment, even if you aren't using my templates I recommend the same dev environment approach http://www.christoc.com/Tutorials/All-Tutorials/aid/1
Using Visual Studio create a new Web Application Project, with a location of /desktopmodules/ in your DNN dev environment. (Follow Step 9 of this tutorial http://www.christoc.com/Tutorials/All-Tutorials/aid/4)
Remove everything that Visual Studio puts into the WAP project (folders, web.config, etc).
Add an assembly reference to DotNetNuke.dll in the website's BIN folder
Right click on the Project properties and set properties on the project to have the Build location be the website's BIN folder (../../bin)
Change the web tab have the following properties set
IISUrl:http://dnndev.me/desktopmodules/MODULENAME
OverrideIISAppRootUrl:True
IIS App Root URL:http://dnndev.me
Add an ASCX file to your project. (view.ascx)
Change the BASE class for the ASCX file to inherit from PortalModuleBase
Compile your module
Register the module with DNN (host/extensions)
Add the Module to a page.
TL;DR
Save yourself the trouble of steps 2-8 and 10 by using the template.
Honestly, the best bet if you want is use Chris's template as a base, and edit it to get it as plain as you want it to be.
I have a plain template that only has the MSBuild configuration in it as I don't even have local copies of DNN on any of my development machines.
The key magic pieces of his template is the MSBuild stuff, and I go one step further and use NuGet to manage the packages/references to DNN that way I don't have any other DNN files locally.
This is what I used to do BEFORE I started using a template. Very similar to #bdukes but rather than developing in the DesktopModules folder, I like to keep my modules in their own projects outside DNN.
In Visual Studio, select File -> New -> Project.
Select '.NET Framework 4' from the version dropdown and C# -> Web from the tree pane on the left then 'ASP.NET Empty Web Application'.
Delete the web.config file.
Add a reference to the DotNetNuke dll.
Add a new user control to the project, this will be your main view for your project.
Make sure the user control inherits from DotNetNuke.Entities.Modules.PortalModuleBase instead of System.Web.UI.UserControl.
Build the project in Visual Studio.
Right click on the Project in Visual Studio and select 'Open Folder in File Explorer'.
Copy the DLL of your project into the bin folder of your dotnetnuke instance.
Paste the project folder in your DotNetNuke instances DesktopModules folder.
Delete all files except the user control you created from the folder you pasted under DesktopModules.
Login into your DNN instance.
Navigate to Host -> Extensions -> Create New Module.
Select 'Control' from the dropdown.
Select the module folder (not owner folder) you pasted in DesktopModules.
Give your module a name and tick the option 'Add Test Page'.
Click 'Create Module'.
You will then be taken to a test page with your new module running with only an empty user control. You can then add controls into the modules folder, rebuild and copy the new DLL into DNN's bin folder and you'll see the changes in DNN.
I would then go back to Host -> Extensions and click edit (the pencil) next to the newly created module. At the bottom of the page there is a 'Create Package' button. Follow the prompts until you're at the preview manifest file. Copy this as your modules manifest file and add it to your project.
Don't forget to add any new views, edits, settings controls to the module definitions and re-create the manifest. (Host -> Extensions and click edit (the pencil) next to the module -> Module Definitions heading)

How to I access the template that DotNetNuke uses when creating new pages?

I recently applied a new skin to one of our existing DotNetNuke CE sites. The upgrade of the site worked, but when I add a brand new page (not imported) to the site there are some issues.
DotNetNuke attempts to copy content from my Slogan Pane, and Top Pane when I add a new page. However, it creates multiple copies of each (about 25 of each module in each Pane). I then have to take my new TabID, go into the TabModules table, and manually delete the duplicate rows to get the new page correct.
I am sure there is a template file somewhere that DotNetNuke is utilizing to create new pages. I hope to be able to modify this file to stop the problem or point DNN to a different file to use for default page creation. Does anyone happen to know where this template is? Barring that, is there any way to interrupt/modify the new page process (without source code mod) to fix the issue?
Thank you
Page Templates are stored in the Portals/# folder, where # is the ID of the folder. They can be within ANY folder inside of there, so you might have to dig around a little bit.
I would guess that you perhaps created a page template, and it has the 25 modules in it, but you also have those modules set to "display on all pages" so that is where the duplication comes from.

Resources