The type or namespace name 'WidgetBase' could not be found

Jun 18, 2009 at 8:47 PM

Hi

I am pretty new to dot net, but I have got my BlogEngine project nearly ready to go.  I downloaded the website download and just need to clear up some build errors. 

I managed to add the BlogEngine.Core dll to get rid of that namespace error.  But I still have 38 errors, one of which is the 'WidgetBase' namespace error.

Where can I get the dlls so I can add these references in?

 

Thanks in advance!

Dave

Coordinator
Jun 19, 2009 at 7:27 AM

WidgetBase is the WidgetBase.cs file in the App_Code\Controls folder.

Jun 20, 2009 at 2:33 PM

Thanks for the help.

I can't seem to just add a reference like I did with BlogEngine.Core, nothing shows up when I go to References, Add > Reference. 

What do I need to do to fix this error?

Coordinator
Jun 20, 2009 at 9:44 PM

Normally, any files in the App_Code folder are automatically detected and don't need to be referenced.

I'm not sure what types of changes you've been making.  Typically, you just download BE, extract the files into a folder, and it runs.  Are you trying to convert BE into a WAP project?

Jun 22, 2009 at 10:15 AM

I downloaded the website, copied it into a new project and had these errors from the start.  The only changes I have made are styles etc.

I orginially had 105 errors but I managed to reference the BlogEngine.Core dll so that reduced it to 39.  That leaves me with WidgetBase and a couple of others which I'll need to check their names at home.

Coordinator
Jun 22, 2009 at 7:44 PM

You're copying BE into a new project ... is that a WAP project where you end up with a single DLL file in the BIN directory when compiling the project?

BE is designed as a "web site project" that would normally be opened as File -> Open -> Web Site... in VS.  Website projects have an App_Code directory.  Any files in the App_Code folder automatically get compiled into the project.  Website projects also don't get compiled into a single DLL file in the BIN directory.  The only DLL in the BIN directory of BE is usually just the BlogEngine.Core.dll file.  The rest of the code gets compiled on-demand the first time it runs and the DLLs from this compilation are in the Temporary ASP.NET Files folder.  This is how a normal Website project works.

If you're trying to run BE in a WAP (web application project), in this post back on February 14th, I put together a step-by-step of converting BE into a WAP project.  This might help you out.

Jun 22, 2009 at 9:17 PM

 

I have the App_Code folder in the Solution Explorer and in the bin directory I have the BlogEngine.Core.dll as the only dll and a BlogEngine.Core.XML file.

If I do File > Open > WebSite it is NOT in the list...

So, it sounds like I am trying to use BE as a WAP project?  I guess I need to convert it using your instructions?

Thanks again for all your help!

Coordinator
Jun 22, 2009 at 9:38 PM

In VS, when you do File -> Open -> Web Site... the "Open Web Site" dialog window opens up and on the left side tabs, you can either select "File System" or "Local IIS" for files on your computer.  If you select File System, then the dialog window shows folders and you would just select the folder that the BE web files are in.  So in this case, you're not selecting a SLN or a CSPROJ file since website projects don't have SLN or CSPROJ files.

When you're using a WAP project, the App_Code folder doesn't do anything.  I think you actually want to avoid having a folder named App_Code in a WAP project since files in that folder will get double compiled or something like that.  This is why I suggest renaming App_Code to something else like Old_App_Code in step 4 of that 'convert to WAP' post I did before.

Jun 23, 2009 at 9:43 PM

 

Ah ha!  I opened it as a website by going to File > Open Web Site I can open that folder.  Now, I can do ctrl+F5 and the build succeeds without errors!

Thanks a lot for your help, this is such a steep learning curve, but its good to be getting somewhere with it.