Problem installing modules

Topics: Troubleshooting
Dec 7, 2011 at 12:07 PM

Hi there,

I have a problem installing modules where I receive the following error:

"Version string portion was too short or too long"

Any module I try to install gives the same error. I realise the exception is being thrown from within ADO.Net or SQL rather than Orchard, but I've had the same problem on 3 different installations of Orchard on 3 different servers, and I've never seen it anywhere before. So I wondered if some other Orchard developers had diagnosed it and come up with a solution or workaround.

Any help much appreciated, thanks.

Dec 7, 2011 at 12:16 PM

Hmm as a matter of fact it IS being thrown from within Orchard:

Orchard.OrchardException: There was an error installing the requested package. This can happen if the server does not have write access to the '~/Modules' or '~/Themes' folder of the web site. If the site is running in shared hosted environement, adding write access to these folders sometimes needs to be done manually through the Hoster control panel. Once Themes and Modules have been installed, it is recommended to remove write access to these folders. ---> System.ArgumentException: Version string portion was too short or too long.
   at System.Version.TryParseVersion(String version, VersionResult& result)
   at System.Version.Parse(String input)
   at Orchard.Packaging.Services.ExtensionReferenceRepository.b__4(<>f__AnonymousType2`2 <>h__TransparentIdentifier0) in d:\JustGiving\Website\Orchard\Orchard\Modules\Orchard.Packaging\Services\ExtensionReferenceRepository.cs:line 44
   at System.Linq.Enumerable.<>c__DisplayClass12`3.b__11(TSource x)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.d__0.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.d__0.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId, Version version)
   at NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId)
   at NuGet.ProjectInstallWalker.OnBeforeDependencyWalk(IPackage package)
   at NuGet.PackageWalker.Walk(IPackage package)
   at NuGet.InstallWalker.ResolveOperations(IPackage package)
   at NuGet.ProjectManager.Execute(IPackage package, IPackageOperationResolver resolver)
   at NuGet.ProjectManager.AddPackageReference(IPackage package, Boolean ignoreDependencies)
   at NuGet.ProjectManager.AddPackageReference(String packageId, Version version, Boolean ignoreDependencies)
   at NuGet.ProjectManager.AddPackageReference(String packageId, Version version)
   at Orchard.Packaging.Services.PackageInstaller.ExecuteInstall(IPackage package, IPackageRepository packageRepository, String sourceLocation, String targetPath) in d:\JustGiving\Website\Orchard\Orchard\Modules\Orchard.Packaging\Services\PackageInstaller.cs:line 132
   at Orchard.Packaging.Services.PackageInstaller.InstallPackage(IPackage package, IPackageRepository packageRepository, String location, String applicationPath) in d:\JustGiving\Website\Orchard\Orchard\Modules\Orchard.Packaging\Services\PackageInstaller.cs:line 81
   at Orchard.Packaging.Services.PackageInstaller.Install(String packageId, String version, String location, String applicationPath) in d:\JustGiving\Website\Orchard\Orchard\Modules\Orchard.Packaging\Services\PackageInstaller.cs:line 51
   at Orchard.Packaging.Services.PackageManager.<>c__DisplayClass8.b__7() in d:\JustGiving\Website\Orchard\Orchard\Modules\Orchard.Packaging\Services\PackageManager.cs:line 65
   at Orchard.Packaging.Services.PackageManager.DoInstall(Func`1 installer) in d:\JustGiving\Website\Orchard\Orchard\Modules\Orchard.Packaging\Services\PackageManager.cs:line 33
   --- End of inner exception stack trace ---
   at Orchard.Packaging.Services.PackageManager.DoInstall(Func`1 installer) in d:\JustGiving\Website\Orchard\Orchard\Modules\Orchard.Packaging\Services\PackageManager.cs:line 43
   at Orchard.Packaging.Services.PackageManager.Install(String packageId, String version, String location, String applicationPath) in d:\JustGiving\Website\Orchard\Orchard\Modules\Orchard.Packaging\Services\PackageManager.cs:line 65
   at Orchard.Packaging.Controllers.PackagingServicesController.InstallGallery(String packageId, String version, Int32 sourceId, String redirectUrl) in d:\JustGiving\Website\Orchard\Orchard\Modules\Orchard.Packaging\Controllers\PackagingServicesController.cs:line 112
I'll try to reproduce in the Orchard source and post results here

Dec 7, 2011 at 12:23 PM

Solved!

In my themes Theme.txt file I had specified:

Version: 0

This was causing the exception

Changed to:

Version: 1.0.0.0
All good.