Unable to build 1.4 website in Visual Studio 2010

Topics: Core, Customizing Orchard, General, Troubleshooting
Mar 10, 2012 at 1:03 AM
Edited Mar 10, 2012 at 1:04 AM

I am using Orchard 1.4 in Visual Studio 2010 as a web project. Everything runs and works well as expected but I am unable to compile. When I do, I get various errors as shown below. Is there a trick to get this to compile properly inside Visual Studio?

  1. Error 577 The type or namespace name 'AdminIndexViewModel' could not be found (are you missing a using directive or an assembly reference?) c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\42e430a6\de062321\App_Web_1qzu333a.3.cs 48 
  2. Error 575 The type or namespace name 'Alias' does not exist in the namespace 'Orchard' (are you missing an assembly reference?) C:\Content\Source Code\Web\Modules\Orchard.Alias\Views\Admin\Index.cshtml 3 
  3. Error 576 The type or namespace name 'Alias' does not exist in the namespace 'Orchard' (are you missing an assembly reference?) C:\Content\Source Code\Web\Modules\Orchard.Alias\Views\Admin\Index.cshtml 4 


Developer
Mar 10, 2012 at 1:08 AM

Did you download the complete source and opened Orchard.sln? Because only then will the references be setup correctly in the solution and projects and will you be able to compile the solution.
If you opend the directory as a website, then you will not be able to compile it, unless you manually add the references (which you should not do).

Mar 10, 2012 at 1:09 AM

I opened the directory as a project as I didn't think I needed the full source. I will do that instead then.

Just curious, why isn't it a good idea to add the references to the web project?

Developer
Mar 10, 2012 at 1:57 AM

Because that would just be extra work :) If you want to compile the solution, use the full source code, and all of the references will be setup correctly.

Mar 10, 2012 at 2:01 AM
Edited Mar 10, 2012 at 2:02 AM

LOL. I thought there was actually a good reason behind that specific to Orchard. I've opened up the source version and while I like that everything is nicely organized and it all compiles well, I am having a hard time justifying why I would want to open up 63 projects every time I need to modify the source of my theme and modules in my site.

Is this normal? What's your experience for a commercial website where the source needs to be tracked in TFS?

Coordinator
Mar 10, 2012 at 2:18 AM

You should create your own solution with only the modules that you need to work on. You can remove all the ones from /Modules from the solution itself. Orchard will still work and use them.

Coordinator
Mar 10, 2012 at 2:20 AM

Also, you can edit any file in themes and modules, save and presto! Your site is updated. The thing that may not be obvious is that you don't need to compile *at all*.

Developer
Mar 10, 2012 at 10:39 AM
sebastienros wrote:

You should create your own solution with only the modules that you need to work on. You can remove all the ones from /Modules from the solution itself. Orchard will still work and use them.

Awesome, never even thought of that.

Mar 10, 2012 at 8:56 PM

Thanks guys. Appreciate the quick responses.