OrchardCMS / OrchardDoc

Documentation for Orchard 1.x (not Orchard Core, for that see https://docs.orchardcore.net/).
http://docs.orchardproject.net
142 stars 242 forks source link

"codegen module" cannot add module to Orchard.sln #329

Closed feO2x closed 7 years ago

feO2x commented 7 years ago

Hey everybody,

I'm currently learning about Orchard Modules using the Getting Started with Modules Course using Orchard v1.10.2 in VS2017 Community. When I try to run the command codegen module Orchard.LearnOrchard.FeaturedProduct, this command fails with the following message:

Error executing command "codegen module Orchard.LearnOrchard.FeaturedProduct"

Specified argument was out of the range of valid values. Parameter name: startIndex

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: startIndex

Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: startIndex] at System.String.Insert(Int32 startIndex, String value) at Orchard.CodeGeneration.Commands.CodeGenerationCommands.AddToSolution(TextWriter output, String projectName, String projectGuid, String containingFolder, String solutionFolderGuid) at Orchard.CodeGeneration.Commands.CodeGenerationCommands.IntegrateModule(String moduleName) at Orchard.CodeGeneration.Commands.CodeGenerationCommands.CreateModule(String moduleName)


Command returned non-zero result: Fail

I noticed that this exception is thrown when the Orchard Command Line Interface is trying to add the project to the solution, when I run codegen module Orchard.LearnOrchard.FeaturedProduct /IncludeInSolution:false, then the command executes successfully.

I don't know if this is a bug that should belong in the official Orchard repo, or if I made something wrong. Before, I just created a new theme using Orchard.exe.

rtpHarry commented 7 years ago

Have you renamed your Orchard.sln to something else?

feO2x commented 7 years ago

No, I haven't.

rtpHarry commented 7 years ago

Hmm looks like other people are seeing the issue (https://github.com/OrchardCMS/Orchard/issues/7699) so it's probably not a documentation problem as it used to work.

The structure of the sln file must have changed in some way that its not finding the right place to insert it any more.

Closing it on here as it's now referenced in the proper issue.