Dec 4, 2011 at 8:01 PM
Edited Dec 4, 2011 at 9:02 PM
I did not have any errors when I rebuilt it just now. However, early on when I first was attempting to add a module per the instructions at the beginning of this thread there were some errors and now I'm not sure exactly how I fixed them. I have gone
back to see if I could figure out what I did; turns out when I tried to build my HelloWorld with an Area I had a problem resolving a reference to Orchard and Orchard.Framework and somehow I added references to these and was able to rebuild without errors.
I just looked at my references folder and see that these two are marked as if they are not correct, so I deleted them and now I am not able to find them anywehre in the solution.
So, I tried to start over.
I copied the latest Orchard source into a new folder and then I opened the solution ( H:\BT.CMS\BT.OrchardModuleTraining\Orchard-HelloWorld-Module\Orchard-Source\src\Orchard.sln) in my VS2010
I built the solution - it had no errors.
THen I started it up and created a new site - just used the defaults and created me an admin account with the default admin.
When the new site came up I went to the dashboard, then to Modules and then enabled Code Generation.
From here ( H:\BT.CMS\BT.OrchardModuleTraining\Orchard-HelloWorld-Module\Orchard-Source\src\Orchard.Web ) I opened up a command-line window ( by going to the folder in Explorer and holding the shift key down then right-clicking and selecting "open
command window here."
In that command-line window I then executed the command: bin\Orchard.exe
This gives me the following errors:
Initializing Orchard session. (This might take a few seconds...)
log4net:ERROR [OrchardFileAppender] Unable to acquire lock on file H:\BT.CMS\BT.OrchardModuleTraining\Orchard-HelloWorld-Module\Orchard-Source\src\Orchard.Web\App_Data\Logs\orchard-error-2011.
12.04.log. The process cannot access the file 'H:\BT.CMS\BT.OrchardModuleTraining\Orchard-HelloWorld-Module\Orchard-Source\src\Orchard.Web\App_Data\Logs\orchard-error-2011.12.04.log' because i
t is being used by another process.
log4net:ERROR OrchardFileAppender: Failed to open [H:\BT.CMS\BT.OrchardModuleTraining\Orchard-HelloWorld-Module\Orchard-Source\src\Orchard.Web\App_Data\Logs\orchard-error]. Attempting [H:\BT.C
log4net:ERROR [OrchardFileAppender] Unable to acquire lock on file H:\BT.CMS\BT.OrchardModuleTraining\Orchard-HelloWorld-Module\Orchard-Source\src\Orchard.Web\App_Data\Logs\orchard-debug-2011.
12.04.log. The process cannot access the file 'H:\BT.CMS\BT.OrchardModuleTraining\Orchard-HelloWorld-Module\Orchard-Source\src\Orchard.Web\App_Data\Logs\orchard-debug-2011.12.04.log' because i
t is being used by another process.
log4net:ERROR OrchardFileAppender: Failed to open [H:\BT.CMS\BT.OrchardModuleTraining\Orchard-HelloWorld-Module\Orchard-Source\src\Orchard.Web\App_Data\Logs\orchard-debug]. Attempting [H:\BT.C
Type "?" for help, "exit" to exit, "cls" to clear screen
However, I assumed this was because I still had Visual Studio (or maybe my web-browser with the new site) Open. So I first closed the web browser and tried the command again (after typing quit in the command window. That got the same set of errors.
So I closed my solution in Visual Studio. Then I typed "quit" again in the command window and then "bin\Orcharde.exe" again. This time it worked and I got the 'Type "?" for help, "exit" to exit, "cls" to clear screen.' prompt.
Since I initially had the orchard> prompt even after the above error messages, would it have been ok to continue? I thought not, and haven't tried, but just wondered.
Now I'll continue on with trying to create a module following the code-generation example above.
So next I genereated the new module structure by executing the following command in my command window:
codegen module HelloWorld
This succeeeded. I noticed that my Visual Studio indicated that there was a change and it asked me to upload changed files which I said yes to.
I noticed that now I had the new Module in my Modules folder.
I then went on to edit the manifest (module.txt) and add the Routes.cs and HomeController.cs files. I noticed that I don't have the MVC Intellisense for adding a controller (when I go to add the controller by right-clicking on the controllers folder, it
does not offer me the "Add Controller" in the context menu.) Also, after adding the HomeController.cs file to the Controllers folder manually then, when I go to add the view by right-clicking on the Index Method, again I don't get offered the intellisense
for adding a view. So I had to create that also by hand. So I created a folder underneath the Views folder named Home then created a view file names HelloWorld.cshtml. Is this the expected behavior, or should I be seeing the intellisense as in the past.
However, after following all of this, I was able to build the Hello World Module.
Thanks for the help.
Now I will try something a bit more complex.