Can Orchard 8.x be build on a build server with only .NET SDKs installed

Topics: Administration, Core, General, Installing Orchard, Troubleshooting
Oct 9, 2014 at 10:27 PM
I have spent all day on this and I am a little frustrated.

So to answer your question ahead of time...yes... I HAVE seen this page...
http://docs.orchardproject.net/Documentation/Building-and-deploying-Orchard-from-a-source-code-drop

My issue is that I do NOT have visual studio on my build server. I have the Windows 7.1 SDK on the build server. I also have the Windows 8.1 SDK on my build server. I have used the Windows SDK configuration tool to configure the SDK to use the 8.1 SDK.

The problem is that the Windows 8.1 SDK does NOT come with a command prompt. Even with the above configuration I am unable to build because the only command environment is 7.1 and it is choking on the .net 4.5 references.

What am I missing here? Or am I correct that you cannot build orchard on a build server unless it has Visual Studio installed? If the answer to that is YES will the VS 2013 Express edition do?

Please help? How do you build on a build server?

Seth
Oct 10, 2014 at 3:03 PM
All you need to build the orchard is the msbuild. You won't need the whole of Visual Studiio installed.

Just run the build.cmd from src, which executes the msbuild command.

You should be able to get it msbuild from here:
http://www.microsoft.com/en-us/download/details.aspx?id=40760
Oct 11, 2014 at 3:58 AM
Rudolph,

Thank you very much for your answer.

I thought that it would be that simple, too. However, I could never to get it to work for me. I spent a good bit of the day just working through issues with our source that were causing build issues. But after that I could never get it to build correctly. I DID get it to build without errrors using the precompile option however it did not produce the correct output. It only created the Compile folder, it did not create the Precompiled or Stage folders which is where the deployable build is supposed to end up.

It works perfectly on my developer box but, of course, that is because I have VS Pro on my machine. But no joy on our build server, even with VS Express installed.

I would love to be proven wrong. Have you actually ever build or seen orchard get built on a build server without VS installed? All of the official documentation I have seen explicitly say that a VS or SDK command prompt is required.

Seth
Oct 11, 2014 at 4:03 AM
Actually, after I looked more carefully at your hyperlink I am now wondering if that is EXACTLY what I need.

It does not explicitly say that it provides a build command prompt but the description definitely fits.

I will give it a go on Monday. Thanks again for the link.

Seth
Nov 7, 2014 at 8:01 PM
Edited Jan 13, 2015 at 2:45 PM
This is a late answer. Bottom line is that I did eventually get our build server to build orchard projects. I am not sure if this is a complete answer or not as I should have answered as soon as I had it done. But I pretty sure this will work.

One other thing to note...It is quite possible that not all of these steps are required. I tried a lot of different things and it might be in the end some of the steps were not needed. It might also reflect a problem on our build server...especially the fact that I had to manually add registry entries.

But here it is without details.

Install the .NET Framework SDK for Windows 7.1.
http://www.microsoft.com/en-us/download/details.aspx?id=8279

Install the .NET 4.5 Full
http://www.microsoft.com/en-us/download/details.aspx?id=30653

Install Visual Studio 2013 Express for Web
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx

Install the Visual Studio 2013 Build Tools
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx

Finally, even after that...it didn't work until I added the following registry keys. I would attach the .reg file but I don't see how.
Save the lines between the lines into a fixBuild.reg file. Then double click...

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7]
"FrameworkDir32"="C:\Windows\Microsoft.NET\Framework\"
"FrameworkDir64"="C:\Windows\Microsoft.NET\Framework64"
"11.0"="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\"
"FrameworkVer32"="v4.0.30319"
"FrameworkVer64"="v4.0.30319"
"12.0"="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\"

Finally, to actually do the build, I created a batch file that does the build.
Save the lines between the lines into a doBuild.cmd file. Be sure to place this in the root of the source download...then double click to build...

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
msbuild /t:FastBuild Orchard.proj

The first line gets your environment ready. The second build the project using the FastBuild target in the Orchard.proj file. You can read that file if you want to try other build targets.

******* EDIT
There is one thing I forgot to mention. And that is that one thing you have to do to get this to work is that you have to edit some CSPROJ files because the command line build fails with errors like these...

<path>\Orchard\src\Orchard.Web\Modules\CKEditor\CKEditor.csproj(337,6): error : "None" element name for include "Placement.info" should be "Content".
<path>\Orchard\src\Orchard.Web\Modules\Orchard.Tokens\Tests\Orchard.Tokens.Tests.csproj(82,6): error : "None" element name for include "app.config" sh
<path>\Orchard\src\Orchard.Web\Modules\TinyMceDeluxe\TinyMceDeluxe.csproj(377,6): error : "None" element name for include "app.config" should be "Cont
<path>\Orchard\src\Orchard.Web\Modules\Upgrade\Upgrade.csproj(156,6): error : "None" element name for include "app.config" should be "Content". [C:\Us
<path>\Orchard\src\Orchard.Web\Themes\Themes.csproj(280,6): error : "None" element name for include "Upward\Views\Content-Story.Detail.cshtml" should

The fix is to do exactly what the error indicates. Open the csproj files and search/replace "<None " with "<Content ".

Also, some of the projects reference app.config files that do not exist in source. You also have to remove those references. I usually just delete the content node entirely or the group entirely.

Seth
Marked as answer by sethspearman on 11/7/2014 at 12:01 PM