Packaging and Installation of a Module

Topics: Administration, General, Installing Orchard, Jobs
Feb 21, 2015 at 12:21 PM
Edited Feb 23, 2015 at 11:49 AM
Hi,

I have an issue in Packaging and Installation of the Module in Orchard. I had created few custom Modules in Orchard and after creating the packages from CMD prompt its creates a .nupkg file, when i install this .nupkg file my module is not working as expected. Then When i saw the Module folder i absroved that few folders like bin and obj are missing in the package file. Please Suggest a solution for this ASAP.

Thanks & regards,
Sunny
Feb 22, 2015 at 12:15 AM
I think the missing folders are ok, because they should created by the dynamic compilation by orchard, I guess.
Can you check the logfile and post the error message here? (Maybe it is a missing reference!?!)
Feb 23, 2015 at 12:10 PM
Edited Feb 23, 2015 at 12:10 PM
Hi,

Please find the Error Messages from Log files.
  1. The below Error Message is from the Orchard-Debug file in Log Folder.
2015-02-21 01:06:58,439 [8] Orchard.Environment.DefaultBuildManager - (null) - Error when compiling assembly under ~/Modules/Custom.EditProfile/Custom.EditProfile.csproj.
System.Web.HttpCompileException (0x80004005): e:\Web\ATFARewrite\wwwroot\Modules\Custom.EditProfile\ViewModels\ManageYourPasswordViewModel.cs(22): error CS0246: The type or namespace name 'Compare' could not be found (are you missing a using directive or an assembly reference?)
at System.Web.Compilation.AssemblyBuilder.Compile()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetCompiledAssembly(String virtualPath)
at Orchard.Environment.DefaultBuildManager.GetCompiledAssembly(String virtualPath) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\IBuildManager.cs:line 53
2015-02-21 01:06:58,501 [8] Orchard.Environment.Extensions.ExtensionManager - (null) - No suitable loader found for extension "Custom.EditProfile"
2015-02-21 01:07:00,763 [8] Orchard.Environment.DefaultBuildManager - (null) - Error when compiling assembly under ~/Modules/Custom.ForgotPassword/Custom.ForgotPassword.csproj.
System.Web.HttpCompileException (0x80004005): e:\Web\ATFARewrite\wwwroot\Modules\Custom.ForgotPassword\ViewModels\ChangePasswordViewModel.cs(14): error CS0246: The type or namespace name 'Compare' could not be found (are you missing a using directive or an assembly reference?)
at System.Web.Compilation.AssemblyBuilder.Compile()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp
  1. The below Error Message is from the Orchard-Error file in Log Folder.
2015-02-21 05:49:52,429 [9] Orchard.Recipes.Services.RecipeStepExecutor - Default - Recipe execution 96ef8da391ae40ab8120e0ca3a149943 was cancelled because a step failed to execute
http://162.123.109.48:225/Packaging/PackagingServices/InstallPackageDetails?redirectUrl=/Admin/Modules
Orchard.OrchardException: Failed to get state for feature Custom.Utility.
at Orchard.Environment.Features.FeatureManager.<>c__DisplayClass2c.<EnableFeature>b__20(String fId) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 152
at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator
1.MoveNext()
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector)
at Orchard.Environment.Features.FeatureManager.<EnableFeature>b__1e(String currentFeatureId, IDictionary
2 featuresState) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 147
at Orchard.Environment.Features.FeatureManager.GetAffectedFeatures(String featureId, IDictionary2 features, Func3 getAffectedDependencies) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 207
at Orchard.Environment.Features.FeatureManager.EnableFeature(String featureId, IDictionary2 availableFeatures, Boolean force) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 165
at Orchard.Environment.Features.FeatureManager.<>c__DisplayClass9.<EnableFeatures>b__4(String featureId) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 73
at System.Linq.Enumerable.WhereSelectListIterator
2.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Orchard.Environment.Features.FeatureManager.EnableFeatures(IEnumerable
1 featureIds, Boolean force) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 72
at Orchard.Recipes.RecipeHandlers.FeatureRecipeHandler.ExecuteRecipeStep(RecipeContext recipeContext)
at Orchard.Recipes.Services.RecipeStepExecutor.ExecuteNextStep(String executionId)
2015-02-21 05:49:52,538 [9] Orchard.Exceptions.DefaultExceptionPolicy - Default - An unexpected exception was caught
http://162.123.109.48:225/Packaging/PackagingServices/InstallPackageDetails?redirectUrl=/Admin/Modules
Orchard.OrchardCoreException: Recipe execution with id 96ef8da391ae40ab8120e0ca3a149943 was cancelled because the "Feature" step failed to execute. The following exception was thrown: Failed to get state for feature Custom.Utility.. Refer to the error logs for more information.
at Orchard.Recipes.Services.RecipeStepExecutor.ExecuteNextStep(String executionId)
at Orchard.Recipes.Services.RecipeScheduler.ExecuteWork(String executionId)
at Orchard.Events.DelegateHelper.<>c__DisplayClass2b2.<BuildAction>b__2a(Object target, Object[] p) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Events\DelegateHelper.cs:line 116
at Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String messageName, String interfaceName, String methodName, IDictionary
2 arguments, IEnumerable& returnValue) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Events\DefaultOrchardEventBus.cs:line 81
at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary2 arguments, IEnumerable& returnValue) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Events\DefaultOrchardEventBus.cs:line 67
at Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary
2 eventData, IEnumerable& returnValue) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Events\DefaultOrchardEventBus.cs:line 53
2015-02-21 06:39:28,841 [11] Orchard.Recipes.Services.RecipeHarvester - Default - Could not discover recipes because module 'Custom.ForgotPassword' was not found.
http://162.123.109.48:225/Packaging/PackagingServices/InstallLocally?redirectUrl=/Admin/Modules
2015-02-21 06:39:42,756 [27] Orchard.Recipes.Services.RecipeStepExecutor - Default - Recipe execution 6f189bab3d4946ae8d334091d3c37a69 was cancelled because a step failed to execute
http://162.123.109.48:225/Packaging/PackagingServices/InstallPackageDetails?redirectUrl=/Admin/Modules
Orchard.OrchardException: Failed to get state for feature Custom.Utility.
at Orchard.Environment.Features.FeatureManager.<>c__DisplayClass2c.<EnableFeature>b__20(String fId) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 152
at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator
1.MoveNext()
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector)
at Orchard.Environment.Features.FeatureManager.<EnableFeature>b__1e(String currentFeatureId, IDictionary
2 featuresState) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 147
at Orchard.Environment.Features.FeatureManager.GetAffectedFeatures(String featureId, IDictionary2 features, Func3 getAffectedDependencies) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 207
at Orchard.Environment.Features.FeatureManager.EnableFeature(String featureId, IDictionary2 availableFeatures, Boolean force) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 165
at Orchard.Environment.Features.FeatureManager.<>c__DisplayClass9.<EnableFeatures>b__4(String featureId) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 73
at System.Linq.Enumerable.WhereSelectListIterator
2.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Orchard.Environment.Features.FeatureManager.EnableFeatures(IEnumerable
1 featureIds, Boolean force) in c:\Test\External_Websites\Main\Source\TFA_Rewrite\src\Orchard\Environment\Features\FeatureManager.cs:line 72
at Orch
Feb 23, 2015 at 3:57 PM
Edited Feb 23, 2015 at 4:09 PM
Hi!
Thanks for the logs. Can you check if you have a dependency on a third party dll (maybe something like 'Compare'?).
e:\Web\ATFARewrite\wwwroot\Modules\Custom.EditProfile\ViewModels\ManageYourPasswordViewModel.cs(22): error CS0246: The type or namespace name 'Compare' could not be found (are you missing a using directive or an assembly reference?)
If that is the case you have the third party dll explicit to the nuget package (check out this link ).

Edit: Maybe I should check, if Orchard Packaging does it on its own :)
Edit2: As far as I can see the package manager should do this for you, but can you check if all third party dll's are present after installing the module?!