This project is read-only.

Setting up a custom gallery server

Topics: General
Feb 10, 2012 at 6:53 PM

We are attempting to setup a custom gallery server.  It seems like the gallery server is really just a website running Orchard that has a gallery module installed.

I was able to:

  • Setup an orchard site
  • Download and enable 4 of the modules listed as required (voting, reviews, profile...)
  • It errored when I didn't have lucene enabled, so I had to install and enable that 

I'm stuck at the part in the readme.txt that came with the gallery server project that states that I need to configure some URLS:

"Under Gallery Settings there are two URL's to configure for your instance of Gallery Server (see for more information)."

I went to that page, but I didn't see any documentation regarding this.

The readme also states:

"to add the OrchardGallery theme, clone to Orchard.Web/Themes/OrchardGallery."

I downloaded the source from the zip on that page and placed it into Themes/Orchard.Gallery, but received this error:

CS0535: 'Orchard.Gallery.Handlers.UserEventHandler' does not implement interface member 'Orchard.Users.Events.IUserEventHandler.LoggedIn(Orchard.Security.IUser)'

Can someone advise how to proceed?

Feb 13, 2012 at 5:54 PM

I had my wires crossed, apparently because I was setting up the website with the gallery server module, and not the gallery server project from

I've not got it up and running, but when I add the feed as an option in the admin, it gives me a whole list of errors...I'll report back when I have a better grasp on what's going on...

Feb 13, 2012 at 6:10 PM

Does anyone know where I need to put nupkg files for them to show up using my custom gallery feed? I tried app_data/Packages but when I choose my custom feed in the admin, it shows up as empty...

Feb 13, 2012 at 7:02 PM

Do you need all the features from this gallery, or could you just use the new gallery implementation that is using ?

Feb 13, 2012 at 7:10 PM

Well, here's what we're hoping to do...

Our connection from our local machines to the dev database can be rather slow because of where it is hosted.  We want to have each developer use a local install of orchard working with a CE database.  We'll create our modules, and then when we're done, we'd like to upload the package to a repository of our developed modules (accessible to us internally only) in addition to still being able to access modules from the main orchard feed.

So, when we want to deploy our module to our dev or review server, we can login to the admin panel and install it using our custom gallery server.

I'm not aware of the new gallery implementation that is using, but if it's somethign that helps us get closer to our goal of having what amounts to a central custom module server for our internal dev team, I'm all ears.

Feb 13, 2012 at 7:14 PM

The gallery that Orchard is using provide Reviews, categorization, and themes management. I think you won't miss it if it's not there. 

The code and setup instructions are here:

In Orchard, just register a new Gallery feed. Though we haven't tried it, I hope you won't get into schema compatibility issues ...

Feb 13, 2012 at 7:16 PM

Yeah, we don't need reviews or anything like that, just a central repository.  This is interesting, so we can point Orchard's gallery at any old nuget feed? I've just become aware that one of our devs already setup a nuget feed for other stuff we have developed.

Feb 13, 2012 at 7:34 PM

I get an error when going to the gallery after adding my feed:

Error loading extensions from gallery source 'Default'. An error occurred while processing this request..
An error occurred while processing this request.
No property 'PackageType' exists in type 'NuGet.Server.DataServices.Package' at position 2.
Feb 13, 2012 at 7:35 PM
Edited Feb 13, 2012 at 7:37 PM

It might be less effort overall to simply xcopy your modules to the dev/review servers. 

In my case I built an msbuild  script that calls the default Orchard build script. It builds and packages the entire orchard source, including my own modules and 3rd party ones. My recipes initially downloaded external modules from the gallery but I commented that out because I found the process of including everything in a custom build to be easier overall. 

This also makes it pretty easy to build custom packages specific to dev/qa/staging/prod environments. I'm using slightly different recipes for development vs. prod (a little less data so I can rehydrate faster, and i'm not using the Combinator module in my development, to make js and css debugging easier). 

Feb 13, 2012 at 7:39 PM

We use teamcity, so I could also have teamcity watch a project that will autodeploy to the dev servers when any nupkg file is checked in.  We might eventually go that route if this gallery server thing doesn't pan out, as it would be nice and elegant for us to just point it to a feed...though, we'd need a way to get the packages up to the feed server anyways...

Feb 14, 2012 at 4:31 PM

We've had no luck setting up the gallery server thus far.

@Sebastien, there seems to be two projects:

Gallery Server Module - Looks like this is just an orchard website that you install the gallery server module and the gallery theme in place. I've got this setup, but I can't find where the feed url is to attempt to try this.

Gallery Server Project - This looks like a wrapper for the Gallery Server API that exposes a feed url.  When I attempted to add that URL as a feed, it allows it and doesn't error, but the search results, do not show any packages available.  How do I get that project to serve up packages?

Like you said, we don't need the review/star rating stuff, etc, but we would still like to use something as a feed so our admin panel can see packages from our internal repository.

Feb 17, 2012 at 2:40 PM
Edited Feb 17, 2012 at 2:47 PM

Edit...I found some documentation that says that out of the box that seems like you can setup an orchard site with a gallery module that talks to the gallery server feed and lets you manage packages that way.  I'll just need to dig in and see what I can find about configuring this to happen.

Feb 17, 2012 at 6:14 PM

Actually there is a setup text file which describes exactly every step to execute. Did you find this file ?

Feb 17, 2012 at 6:38 PM

Yeah, I found some files, but I'm running into several issues.  One, the gallery module is throwing errors that it doesn't implement IUserHandler correctly (ConfirmedEmail, ChangedPassword, etc aren't implemented).  I put in stubs for those methods, and then I get errors that two methods in the Taxonomies service weren't found.

Let's take a step back and start from the beginning, because I've confused myself and probably you as well with all my investigations.  So, back to square one...

I think ideally we would like to avoid using the gallery module front-end all together.  Is there a way where we can have the following setup:

Gallery Server feed (currently I have this setup and can browse to the svc file).  We can manually push module packages to this server, we don't need the front-end for this, we just need to know where the location is that holds the packages.

Then point our orchard site at this feed and have it tell us when there are updates available for a given module and let us install them that way?  I actually tried this, but when I add the feed and then visit the gallery section in our orchard site, we get the following errors:

Error loading extensions from gallery source 'Default'. An error occurred while processing this request..
An error occurred while processing this request.
An error occurred while processing this request. Could not load System.Data.SqlServerCe.Entity.dll. Reinstall SQL Server Compact. System.IO.FileNotFoundException at System.Data.SqlServerCe.ExtensionMethods.SystemDataSqlServerCeSqlCeProviderServices_Instance() at System.Data.SqlServerCe.SqlCeProviderFactory.System.IServiceProvider.GetService(Type serviceType) at System.Data.Common.DbProviderServices.GetProviderServices(DbProviderFactory factory) at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() at System.Data.Entity.Internal.Linq.InternalSet`1.Include(String path) at System.Data.Entity.Infrastructure.DbQuery`1.Include(String path) at System.Data.Entity.DbExtensions.Include[T](IQueryable`1 source, String path) at System.Data.Entity.DbExtensions.Include[T,TProperty](IQueryable`1 source, Expression`1 path) at Gallery.Infrastructure.FeedModels.GalleryFeedContext.get_Packages() in C:\Projects\git\OrchardGalleryServer\GalleryServer\src\Gallery.Infrastructure\FeedModels\GalleryFeedContext.cs:line 23 at queryable_reader(Object ) at System.Data.Services.Providers.ReflectionServiceProvider.GetResourceContainerInstance(ResourceSet resourceContainer) at System.Data.Services.RequestUriProcessor.CreateFirstSegment(IDataService service, String identifier, Boolean checkRights, String queryPortion, Boolean isLastSegment, Boolean& crossReferencingUrl) at System.Data.Services.RequestUriProcessor.CreateSegments(String[] segments, IDataService service) at System.Data.Services.RequestUriProcessor.ProcessRequestUri(Uri absoluteRequestUri, IDataService service) at System.Data.Services.DataService`1.HandleRequest() Could not load file or assembly 'System.Data.SqlServerCe.Entity, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at System.Data.SqlServerCe.ExtensionMethods.SystemDataSqlServerCeSqlCeProviderServices_Instance()

Feb 17, 2012 at 7:24 PM

Yes you can use the server as is, and the nuget.exe command line tool to push packages to the server.

Maybe you could cross post this on the gallery server project. Kevin could help too if you have any question.

Feb 17, 2012 at 8:10 PM

I have posted in another post that was having a similar issue. We'll see what comes of it.  We weren't able to push packages to the gallery using nuget, it gave errors there as well...all this leads me to believe something isn't setup correctly on the gallery server.

Thanks for your help, we'll get to the bottom of it.

Feb 17, 2012 at 8:12 PM

You need nuget.exe v1.2

Feb 17, 2012 at 8:21 PM

The command line tool?  My coworker has 1.6 something of nuget, so I assume you mean the command line tool.  If that is the case, we still need to figure out why it errors when we point our site at the gallery server feed url.

Feb 17, 2012 at 8:24 PM

Or are you saying later versions won't work, and only v1.2 will work?

Feb 17, 2012 at 8:37 PM

That's what I am saying. The nuget spec file schemas might not be compatbile, almost sure they aren't. We never wanted to keep with the pace of their releases, because there was no interest into doing so.

Feb 17, 2012 at 8:47 PM

Is that even available as a download anymore? Perhaps I'll check their site and see if they offer previous versions of the command-line utility.

Feb 17, 2012 at 10:28 PM

I think you do need to use the old version of nuget.exe if you want to push packages from the command line to a GalleryServer instance. Remember, Nuget is no longer using the OrchardGallery/GalleryServer so it's likely they've changed how the executable talks to the server.

However, I'm having trouble even getting the old version to push to my local gallery server instance right now. I'm not sure why, but will update here if I figure it out.

Feb 21, 2012 at 7:36 PM

Have you found anything yet kevin?  I've been fighting my way through this also.  I'm now trying to push an orchard module to the server using NuGet.exe (1.2).  However, I get the following error message: "The Package could not be uploaded: ".  I suspect this has something to do with an API key.  I can't seem to find a place in gallery server to set the key.

I've also tried dropping the package in the "App_Data/Packages" folder, but they don't appear in the feed.  I'm assuming metadata needs to be entered in the database.

Feb 21, 2012 at 7:38 PM

1.) Where did you get 1.2? 

2.) When kevink figures out whatever issue he's having, perhaps a quick install overview would be helpful...I know there's a readme there, but I fear there's some missing steps there or maybe steps that need clarification...

Feb 21, 2012 at 7:47 PM
Edited Feb 21, 2012 at 7:49 PM

1.2 is actually included in the gallery server download, but you have to build the included NuGet repo to get the executable.  Here's a copy from my dropbox:

Make sure you leave the .dll next to the executable or it gets angry.

Feb 21, 2012 at 7:51 PM

Thanks brother...much appreciated. Do we need to setup API keys or anything like that? We have a gallery server setup but when I visit the feed URL, it just serves up some XML with no package info in it.  And, if we point our 1.3 version orchard website at it, we get some errors (specified above). 

Feb 21, 2012 at 7:58 PM

I haven't had time to take another look at the issue of pushing to the server with NuGet.exe. But I can at least answer the question about the API keys.

The API keys are only used and understood by the Orchard Gallery site. The Gallery Server feed site doesn't really "know" what they are. It just takes the key in a lot of the API calls and passes it onto the front-end site to validate the call. You can turn that behavior off entirely with a config setting in the AppSettings.config file. It's called "AuthenticatePackageRequests" (yes, that's incorrectly named, should be "Authorize"). If you set that to false then Gallery Server will not bother checking the key - you can pass any GUID in the API calls and it will just ignore it. But if you have that set to true (which is the default) it will try to authorize the calls.

Feb 21, 2012 at 7:58 PM
Edited Feb 21, 2012 at 7:58 PM

tjans: Make sure you are pointing orchard at http://<domain>/feedservice.svc

Feb 21, 2012 at 8:00 PM

Yeah, I was pointing it at the correct spot. I'll disable the API key then and see if that fixes the issue.

Feb 21, 2012 at 8:11 PM

Thanks Kevin!  The push worked.  There still isn't anything showing up in the Gallery from within Orchard, but I'll poke around and see what I can come up with.  Hoping it's a caching issue.

Feb 21, 2012 at 8:31 PM

I set the authenticatepackagerequests to fals, but I'm still getting the following error after pointing our site (not a gallery server, just a plain old orchard site running 1.3) to our feed and then browsing to the gallery in the admin panel:

Feb 21, 2012 at 8:42 PM

The top of the stack says "An error occurred while processing this request.  Could not load System.Data.SqlServerCe.Entity.dll. Reinstall SQL Server Compact."

I would start there :D

Feb 21, 2012 at 8:44 PM

I know, I know, seems obvious, but the thing is, I never installed any SQL Server fact, I've never really used CE except for locally on our dev machines as we have always favored SQL server in the past...I wonder if I need to actually set something up on the server for CE to work correctly...

Feb 21, 2012 at 9:00 PM
Edited Feb 21, 2012 at 9:01 PM

I believe you do have to install it unless you change the appsettings and connectionstring to use regular SQL Server.

Kevin, I'm having trouble getting packages to show up in orchard.  I noticed the query from orchard includes filter=((PackageType%20eq%20'Module').  When I open up the database, the PackageType field is null.  Is there something I have to do when pushing my package to set the PackageType field to "Module"?

Manually changing those fields to "Module" results in an error from the service.

Feb 21, 2012 at 9:23 PM

Is there an "embarrassed' button? Jeez, I shouldn't have assumed SQL CE didn't work right out of the box. I changed it to use SQL Server and it worked.  Now, to try pushing something to our feed. HopefullyI don't run into the same issue Ryanw19 did...

Feb 21, 2012 at 10:05 PM

I am getting a "bad request" when I run the command:

C:\exes\nuget12\NuGet-1.2 push c:\mypackage.nupkg 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -s

Per kevin's instructions I just took any old guid and passed it along...I'm able to hit our feed server url and it resolves to an XML document just fine.  Is the command for 1.2 different? THis is my first attempt at using nuget from the command line...

Feb 21, 2012 at 10:12 PM

I was getting that too and couldn't figure out why. I'll hopefully try again later this week (sorry, tied up with another project right now).

@ryanw19, I forgot about that. If I remember correctly , the Orchard Gallery passes along the package type value when uploading packages to the server. But the Nuget.exe never did that. I think (my memory is a little hazy) that the Nuget team just set a database default for that column since they only had one type of package called "Package" (vs. Orchard which has "Module" and "Theme"). You could try setting the default for that column to "Module" in your instance.

Feb 22, 2012 at 1:48 PM

Ok, I'll give that a try.

tjans: you need to push to the root of the domain (  feedservice.svc is expecting an odata query, not packages.

Feb 22, 2012 at 1:56 PM

I had tried that too and was getting somethign about the resource being moved...something still must not be setup right...

Mar 21, 2012 at 7:16 PM

Posted this in another gallery thread yesterday but will post here as well...


I've setup private galley website and gallery server. I am able to upload nuget packages manually via Gallery website fine but not able to push packages via nuget command line. We tried nuget command line version 1.2, 1.4, 1.5 and 1.6. While using 1.2, 1.4 and 1.5, I don't get any error but package doesn't show up. 1.6 prompts for UN and PW and errors out with "Cannot access closed stream". Which version we should be using?

nuget push -source http://localhost/GalleryServer/ Foo.nupkg {key}

What's the best way to publish nuget packages automatically to gallery website(nuget commandline, team city)?

Apr 11, 2013 at 5:11 PM
So is the current gallery ( running on an older version of orchard? If we wanted to host our own gallery would that be the path of least resistance?
Apr 12, 2013 at 1:40 AM
Yes. It's running on 1.4 iirc.
Jun 21, 2013 at 2:38 AM
tjans wrote:
Does anyone know where I need to put nupkg files for them to show up using my custom gallery feed? I tried app_data/Packages but when I choose my custom feed in the admin, it shows up as empty...
If anyone has an answer for this, it'd be greatly appreciated. I feel like I'm at 99% here, and can't figure out the last 1%!
Jun 24, 2013 at 1:23 AM
Edited Jun 24, 2013 at 1:23 AM
OK, so I've downloaded version 1.2 of nuget as detail above and attempted to push a nupkg to a GalleryServer instance running on IIS with:

nuget-1.2 push Orchard.Module.Contrib.Profile-1.1.nupkg -s http://localhost:85/FeedService.svc/

It appears to work, as in there is no error returned, but when I browse to http://localhost:85/FeedService.svc/Packages() I get nothing:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="http://localhost:85/FeedService.svc/" xmlns:d="" xmlns:m="" xmlns="">
  <title type="text">Packages</title>
    <name />
  <link rel="self" title="Packages" href="Packages" />
What have I missed?
Aug 5, 2013 at 3:05 PM
BenPower, you're trying to send to the FeedService.svc, which expects Odata. You need to send to the root http://localhost:85/
Aug 6, 2013 at 6:07 PM
Is the source code of the gallery server ( available? We have been trying to get a gallery running for 2 days, and need to move on.
Aug 6, 2013 at 7:13 PM but we don't recommend you run this code.