The Daily Shaarli

All links of one day in a single page.

Today - September 1, 2022

Resolving "Validation (): Element ‘xxxx’ is not supported" warning in Visual Studio
When yo get the green squiggly line on unknown elements in Visual Studio, this is the fix.

Notes:

Delete the files from “C:\Documents and Settings[Username]\Application Data\Microsoft\VisualStudio\9.0\ReflectedSchemas” folder (or “…\VisualStudio\8.0\…” if running Visual Studio 2005) in Windows XP. In Windows 7 it is under "C:\Users{User Profile}\AppData\Roaming\Microsoft...etc". Remember also the "VisualStudio" part of the path will be different depending on the version installed.

I closed Visual Studio (always a good idea for changes that will affect the IDE), deleted the files then re-opened the project. The warnings were gone.

I found references to this solution at: http://forums.asp.net/t/1205528.aspx http://blogs.msdn.com/mikhailarkhipov/archive/2005/04/21/410557.aspx

A quick Google search found the solution. FYI, the search term I used in Google was “element is not supported”.

I don't know why this happens but I do know there are some flaky domain profile things happening in the network environment.
How can I set up a super simple listing and details module that uses simple URLs?
I want to set up a simple listing of cards (with a heading, a picture, some text, and a link) and when the user clicks on the link of a card, it brings them to a full "details" view that has a friendly URL. Very similar to a news module but considerably simpler.

So I would have https://mywebsite.com/careers and then a listing. When a user clicks on a career, they would be taken to https://mywebsite.com/careers/dairy-farmer

The URL would be the title of the career. On the details page, there would be a lot more content as well, that the content editor could manage.

Is this video still relevant? https://youtu.be/RtmOYvaeJpo

Or is there a newer, simpler way of doing things? Also, is this something I can set up in the Content module as opposed to the App module?
DNN site running slow
Notes:

Check the DNN Scheduler to see if there are any active jobs that are taking longer than they should. For example, if the Site Crawler scheduler is constantly running then you should check the files in the Portals folders to make sure all of the files located in the Portals folder should actually be there. The crawler is rebuilding the index and if you have a lot of files it could take hours to complete. If the files should be there, disable the crawler scheduler and then run during your slowest time of the day (1:00 AM?). I ran into this problem on a server that had hundreds of thousands of documents in the portals folder. Ended up solving it by running the crawler between 1:00 AM and 5:00 AM for a few days until it indexed all of the files. Once the files are indexed it will only have to index changed and new files; so it should just be a burden the first time it runs.

Another possible cause are exceptions. If your site is throwing a large amount of exceptions it will slow down your site. The handling of the exceptions and then the logging of them (to the DNN EventLog table in the database and the Log4Net files) can be brutal if your site is constantly throwing exceptions. If your site is also running in DEBUG mode the performance hit is multiplied by at least 30 times due to .Net collection all of the additional information about the exception while running in debug mode. That will be brutal to your sites performance.

Check the server logs to see how often IIS is recycling the application pool for your DNN site. If it's occurring often then that is also a sign of a large amount of exceptions being thrown if you are using the default IIS application pool settings. By default, IIS will recycle your application pool if too many exceptions are thrown within a short period of time. If you also have the option set to bring up a new instance of your site and run it side by side before IIS terminates the existing instance while your site is throwing exceptions that can cause a bottleneck and will cripple performance. For this situation, I usually disable IIS from recycling the application pool if too many exceptions are thrown within a short period of time. That may not be the best option for you but if you are on top of the exceptions being thrown on the site then you can disable that and let IIS run instances side by side after an app recycle (this is nice to have when you recycle during active periods so that all existing traffic completes with the old instance and all new traffic is sent to the new instance. Once all traffic is hitting the new instance of your site IIS will terminate the older instance.)

If none of the above help, run SQL Profiler on your database to see if there is any extreme database activities going on. Also check for any db locks.

There are a lot of possible causes that can slow down DNN. The best way to find out what is going on is to run a profiler on the server (RedGate Ants profiler or Telerik (Progress) Just Trace).
OData for Visual Studio Code
thumbnail
Extension for Visual Studio Code - OData query language support.
OData - the Best Way to REST
OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs. OData helps you focus on your business logic while building RESTful APIs without having to worry about the various approaches to define request and response headers, status codes, HTTP methods, URL conventions, media types, payload formats, query options, etc. OData also provides guidance for tracking changes, defining functions/actions for reusable procedures, and sending asynchronous/batch requests.
Downloading and Installing WebP
thumbnail
As a side note, the file size for the PNG is 62.4KB, while the WebP is 29.8KB (52% smaller) with lossless compression using cwebp with the following command line.

C:\> cwebp -lossless -exact caniuse-WebP-Test.png -o caniuse-WebP-Test.webp
How to add an extra view to my DNN module?
I am totally new to DNN development, I made a module using Christoc Modules, and all my logic is in the view.ascx page, I want to add a new view that basically, would be a button that when the user clicks on it the user would be redirected to the view.ascx page, I have looked everywhere to find tutorial or example that is well explained to do this step by step but I didn't find
DNN module on the same page multiple times with different content in the settings