weblogs.asp.net
Monday, April 03, 2017 2:51 PM

If you’re not switching all of your websites to utilize SSL encryption by default, you’re going to miss out on search results for many years to come! (see here for more info)

In the past, the notion of switching all your sites to use SSL would be daunting and a costly affair, especially if you have too many different websites to count (what, not everyone has this problem?).

I’ve been recently setting up a few websites on Azure for test purposes, and decided to look into how I could setup SSL for those sites. I came across a blog post from Rick Strahl regarding using Let’s Encrypt, for free SSL configurations. Basically with Let’s Encrypt, you can get a free SSL certificate, the main catch though is that they need to be renewed very frequently, they expire in 90 days.

From there I came across a Site Extension for Azure that can be setup to automatically configure, assign, and even renew these certificates. This takes quite a bit of work to get setup, but once setup, requesting certificates is super simple. As you add more “custom domains” to your Azure instance you can setup a new certificate for each. One problem I ran into however is that once I had setup two certificates, the extension started throwing an error when trying to add new certificates for domains. The error was:"

Cannot update IP SSL Bindings because total number of allowed IP addresses per site will be exceeded.
CloudException: Cannot update IP SSL Bindings because total number of allowed IP addresses per site will be exceeded.

This I believe is possibly due to my limitations on the Basic App Service that I have setup, where you are limited to SSL IPs, but you can have unlimited SNI SSL certs. Completing the binding process for the SSL certificate is easy, simply go to your Azure Portal, navigate to the App Service and then the SSL Certificates section. Click the Add SSL Binding button, choose your domain and select the appropriate certificate!

Boom, SSL setup and ready to go!

Update: Looks like I had a setting configured incorrectly in the Site Extension, I simply removed the web app setting letsencrypt:UseIPBasedSSL  see this thread: https://github.com/sjkp/letsencrypt-siteextension/issues/118#issuecomment-291241410

weblogs.asp.net
Tuesday, March 07, 2017 1:20 AM

With the release of Visual Studio 2017 coming in a few short hours, I am proud to release the latest update for the Christoc’s DotNetNuke Extension Development Templates!

With this release I’ve updated my suite of DNN extension templates (modules and themes) to support Visual Studio 2017.

You can download these templates from Visual Studio 2017, by going to the Tools/Extensions menu. From there you can search the Online option for “DotNetNuke” choose the “DotNetNuke (DNN) Development Project Templates” option.


image

Other Download Options:

If you have any feedback, please visit the Project’s Github Repo


Here’s a quick video of how to install the templates in Visual Studio 2017


Here’s a quick video on how to make create your first DNN module. After creation the video walks you through the compilation and installation of that module into your DNN site.

weblogs.asp.net
Sunday, March 05, 2017 9:32 PM

In an earlier blog post I talked about the EventLog table and the Exceptions table, specifically in terms of how to “clear” the tables out. This post will talk specifically about how to keep the EventLog table cleaned up to begin with.

In DNN you have the ability to configure if you would like specific EventLogTypes to be tracked or not. By default in DNN there are over 100 different events that can be tracked in the EventLog table. Many of these are turned off by default, you can configure them to be “on” by going to the Admin Logs page in the Persona Bar, and choose the Log Settings tab

image

In doing so you will be presented with a page that looks similar to

image

From here you can click on the Edit pencil on each row and enable or disable the Logging setting

image

You can also turn options on such as email notifications and the Keep Most Recent entries option

image

Some of the default options in DNN will have the Keep Most Recent option configured to a low number, like “10 Entries” but some will have them set to All. This can cause the EventLog table to fill up with many many many events, depending on how much traffic your website gets. You can go through and set these all manually through the ADMIN UI, or you can do it in bulk in the database with this simple SQL statement:

update Eventlogconfig
set keepmostrecent = 10

If you’re using the SQL Console page you can use this statement

update {databaseOwner}{objectQualifier}Eventlogconfig
set keepmostrecent = 10


Warning: You might actually want to keep ALL logs for your site, depends on your industry and needs, but I prefer to keep mine pruned to try to keep the database smaller, more manageable and better performing.

weblogs.asp.net
Sunday, March 05, 2017 9:16 PM

image

At some point, if you manage a DNN based website long enough, you are going to run into a problem where your database seems to have grown WAY bigger than it should be. I’m not talking a couple hundred megs, I’m talking gigabytes, lots of gigabytes. This post will hopefully help you get that under control.

Tonight, I had a DNN instance that I was looking to migrate to Azure, in preparation for this I remoted into the web and database servers to see what the files and database looked like. The database MDF file was almost 1.5gb in size, for a DNN instance that has 5 portals, and very very little activity, this was concerning. I knew where to start looking though, there are two tables to start with, Exceptions and EventLog. The EventLog is tied to the “Admin Logs” in DNN 9, in earlier versions of DNN the menu item was Event Logs or even Event Viewer.

Running the following simple SQL query will get you an idea of how many rows are in those tables.

select count(1) from Exceptions with (nolock)

select count(1) from EventLog with (nolock)

If you’re running this in the SQL Console on your DNN site you might run it with

select count(1) from {databaseOwner}{objectQualifier}Exceptions with (nolock)

select count(1) from {databaseOwner}{objectQualifier}EventLog with (nolock)

This will give you a “count” of the number of rows in each of those tables. In my case, the EventLog table only had 394 records, but the Exceptions table had 300k+. That’s a pretty common cause of database size creep in DNN. Ultimately what my issue was, I had one site that still used “SolPartMenu” in the Containers for the skin, and with DNN9, those no longer work, and every request that tried to load that site (mostly search engines hitting it) caused multiple records to be thrown into the EventLog and Exceptions table.

Message:Object reference not set to an instance of an object.
StackTrace:
at DotNetNuke.UI.Skins.Pane.LoadModuleContainer(ModuleInfo module) at DotNetNuke.UI.Skins.Pane.InjectModule(ModuleInfo module)

Now, the question is how did I know what the cause of that cryptic error message was? Well, I had just spent some time with a customer of mine this weekend upgrading their website, and they ran into the same problem, so it was fresh in my head, and I was easily able to correct this.

But let’s get back to the topic of the post, the Exceptions and EventLog tables. DNN has a way to “purge” the eventlog built into the system, and most “types” of events only get stored 10 times, so when the 11th event comes in, the first one gets cleared from the system. But, the exception Events also get logged to the Exceptions table, and there doesn’t appear to be anything in DNN that cleans that table up automatically. Because I upgraded the site to DNN 9 well over a month ago, I had hundreds of thousands of exceptions in the table. So I needed to get this cleaned up, that’s easy with the following SQL statement.

truncate table Exceptions

or the DNN SQL Console version

truncate table {databaseOwner}{objectQualifier}Exceptions

That forces the table to be purged, and then using SQL Server Management Studio I was able to run a SHRINK command on the database, bringing the files back down to an expected 30 mb.

Now you might think, well can’t I do the same on the EventLog table? Unfortunately the simple answer to that is no. The longer answer is YES, but you’ll want to look at Sebastian’s SQL script for doing so: http://dnnscript.codeplex.com/releases/view/612643

weblogs.asp.net
Monday, February 20, 2017 10:58 PM

I ran into a problem this evening with Visual Studio 2017 hanging when opening my Solution that I'm working on for my DNNTemplates VSIX project. It would open up solution explorer, it would also open up the TABS in visual studio, but it wouldn’t complete the process and would hang on “Opening the files”.

Basically every time I opened the solution, no matter what I tried, rebooting, deleting the .SUO file, deleting the .USER files, nothing would seem to work. I would let Visual Studio site for hours, and it would never complete the opening process.

Finally I went in and deleted the contents of the .VS folder, after deleting this contents the solution can successfully be opened.

So if you run into problems with “Opening the files”, try deleting the contents of the .vs folder in your solution directory, hopefully that will help you.

If anyone from the Visual Studio team wants to reach out to me on this, I have perfview files and files collected from collect.exe as I was trying to troubleshoot the issue.

RSS URL

Chris Hammond is

Chris Hammond is a father, husband, leader, developer and car guy. Chris has long specialized in ASP.NET and DotNetNuke development, so you will find a variety of topics here on the website. For more information check out the about me page.

If you are looking for DotNetNuke consulting please visit my business website at http://www.christoc.com/

Latest Photos

Follow Me Facebook Me Plus Me

Disclaimer

Any blog posts here are solely the opinion and views of Chris Hammond only. Comments on blog posts are the opinion of the commenter, and not Chris Hammond.

DotNetNuke Hosting

Hosting for this website is provided by AppliedI.Net. Be sure to visit them for all your DotNetNuke Hosting needs. 

Powered By

This website is managed by Christoc.com Software Solutions

Find Me