DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

CS0246 The type or namespace name 'DotNetNuke' could not be found

 8 Replies
 2 Subscribed to this topic
 15 Subscribed to this forum
Sort:
Author
Messages
New Around Here Send Private Message
Posts: 0
New Around Here

Hi. I'm trying to create new theme for DNN. I'm totally new to DNN and I was following these instructions: https://christoc.com/Tuto.../All-Tutorials/aid/8

However when I pressed "build" it gave me error:

Error    CS0246    The type or namespace name 'DotNetNuke' could not be found (are you missing a using directive or an assembly reference?)    ProjectName    C:\Websites\...\PopupSkin.ascx.cs    14    Active

What am I doing wrong and how to fix it?

P.S. DNN extension is installed in Visual Studio, I switched mode from debug to release. I'm using Windows 10, Visual Studio 2019, DNN 9.4.1. Full path to DNN website is "C:\Websites\first_dnn_website\dnndev.me".

Veteran Member Send Private Message
Posts: 1245
Veteran Member
You probably need to add a reference to the DotNetNuke.dll found in your installation's bin folder.
Growing Member Send Private Message
Posts: 51
Growing Member
My instructions are pretty specific about the paths to use. If you diverge from those paths, then references start to get funky
New Around Here Send Private Message
Posts: 0
New Around Here

I tried to move it to "C:\Websites\dnndev.me" and update Visual Studio, but it didn't help.

New Around Here Send Private Message
Posts: 0
New Around Here
Posted By Joe Craig on 13 Nov 2019 12:50 PM
You probably need to add a reference to the DotNetNuke.dll found in your installation's bin folder.

Didn't help.

 

 

New Around Here Send Private Message
Posts: 0
New Around Here
Posted By Chris Hammond on 13 Nov 2019 02:22 PM
My instructions are pretty specific about the paths to use. If you diverge from those paths, then references start to get funky

I followed your instructions precisely, but I still stumbled upon same complile error. What did work for me is I scrolled down and after multiple errors about DotNetNuke namespace there was warning (WARNING, CARL! NOT EVEN ERROR!) about that DotNetNuke.dll was compiled using .Net Framework 4.7.2 (DNN version was 9.4.x) and project's target .Net Framework version is 4.5.x. So I needed to change that in project settings. Also I finally stumbled upon your instruction about fixing DNN theme creation errors. Since it happens all the time, you should really include that fix into installation instruction. Before I stumbled upon that video I wasted many hours on research.

Just in case someone needs that fix: https://www.youtube.com/w...0spov4It4Z8fswIbNZFd

First 5 minutes are about wrong path "C:\website\..." instead of "C:\websites\..." and how to cut/paste folder in Windows, second half of the video is actual fix.

 

Veteran Member Send Private Message
Posts: 785
Veteran Member
Hi Constantine,

First of all: welcome to DNN :-)
Second: as I understand you want to create a new theme. My first recommendation would be to play around with the default theme that is shipped. Just to get to know DNN, the skin controls, containers etc.
If you want to step up your game, you might want to take a look at https://github.com/nvisionative/nvQuickTheme.
The documentation is on https://nvisionative.github.io/nvQuickTheme/ and there is also a recording of a session on DNN-Connect that you can find on https://www.youtube.com/watch?v=gFLjScoomQw

When you get the hang of it, you'll find typical issues in/on other themes more easily as most developers have their own take on their work.

Hope this helps with future activities.

Cheers
Tycho

New Around Here Send Private Message
Posts: 1
New Around Here

This worked for me. I needed to add references for DotNetNuke.dll and Microsoft.ApplicationBlocks.Data.dll.

Advanced Member Send Private Message
Posts: 250
Advanced Member
And nowadays most people refer to the nuget packages instead of local library references. But if you do, you need to also make sure the build process does not publish those files to mess up your development environment.
Themes that don't really use C# don't really need to have any references (which is very often the case for a theme).

These Forums are dedicated to the discussion of DNN Platform.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved