Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed the OrchardCore clone dependency to make this repo stand alone #65

Merged
merged 9 commits into from
Aug 17, 2020

Conversation

DrewBrasher
Copy link
Contributor

Resolved this issue:
Build against Orchard packages instead of project references #64

…tion folder. Changed Orchard Core references from project references to NuGet package references. Added a package reference to OrchardCore.Module.Targets.
Removed the OrchardCore clone dependency from the "Setting up your dev environment" instructions in the readme
@agriffard
Copy link
Member

What prevents you from using the rc2 version?
https://www.nuget.org/packages/OrchardCore.Application.Cms.Targets/1.0.0-rc2-13450

.gitignore should probably exclude the .po files.

A specific Setup recipe could enable some required features and execute the Product.recipe.json to create the Product content type (can be done in another PR).

@DrewBrasher
Copy link
Contributor Author

@agriffard I have ignored the .po files and updated the package references to rc2.

The reason it was rc1 was because I used MyGet instead of NuGet because the readme said to use the dev branch of OrchardCore and I thought MyGet was where the dev branch was published to based on the www.ideliverable.com/blog/getting-started-with-orchard-core-as-a-nuget-package post which was linked to in https://docs.orchardcore.net/en/dev/docs/getting-started/ .

@bleroy
Copy link
Member

bleroy commented Aug 17, 2020

Looks like the po files are still there.

Copy link
Member

@bleroy bleroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except for the po and .git* files. Thanks!

.gitignore Show resolved Hide resolved
SampleWebApp/wwwroot/.placeholder Outdated Show resolved Hide resolved
@bleroy
Copy link
Member

bleroy commented Aug 17, 2020

Thanks, this looks great. I'll merge it now, and I'll play with it tonight. Then, once I'm happy with the stability of the branch, I'll merge into main so others can use the new project structure as the basis for new code.

@bleroy bleroy merged commit 02684cc into OrchardCMS:checkout-process Aug 17, 2020
@bleroy
Copy link
Member

bleroy commented Aug 18, 2020

Something's wrong. Can't get past setup:

An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.
C:\projects\orchardcore\src\OrchardCore.Modules\OrchardCore.Contents\Views\_ViewImports.cshtml
One or more compilation references may be missing. If you're seeing this in a published application, set 'CopyRefAssembliesToPublishDirectory' to true in your project file to ensure files in the refs directory are published.

    The type or namespace name 'AddToDeploymentPlan' does not exist in the namespace 'OrchardCore.Contents.Deployment' (are you missing an assembly reference?)

    @using OrchardCore.Contents.Deployment.AddToDeploymentPlan

The type or namespace name 'ExportContentToDeploymentTarget' does not exist in the namespace 'OrchardCore.Contents.Deployment' (are you missing an assembly reference?)

    @using OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget

The type or namespace name 'Download' does not exist in the namespace 'OrchardCore.Contents.Deployment' (are you missing an assembly reference?)

        @using OrchardCore.Contents.Deployment.Download

@bleroy
Copy link
Member

bleroy commented Aug 18, 2020

The test project is also broken:

---------- Starting test discovery ----------
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Unable to find C:\Projects\OrchardCore.Commerce\OrchardCore.Commerce.Tests\bin\Debug\netcoreapp3.1\testhost.dll. Please publish your test project and retry.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostPath(String runtimeConfigDevPath, String depsFilePath, String sourceDirectory)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
========== Test discovery aborted: 0 Tests found in 190.9 ms ==========

@DrewBrasher
Copy link
Contributor Author

I will look into those.

@DrewBrasher
Copy link
Contributor Author

I'm not getting the same error as you got when running the site. I was able to setup the site (used the agency theme), enable the 3 Commerce features, add a product content type (with product, price, and title parts), add a test product, and view the product page.

image

But I get this error when I try to add the test product to the cart:

System.InvalidOperationException: Unable to resolve service for type 'OrchardCore.Workflows.Services.IWorkflowManager' while attempting to activate 'OrchardCore.Commerce.Controllers.ShoppingCartController'.
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired)
   at lambda_method(Closure , IServiceProvider , Object[] )
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass4_0.<CreateActivator>b__0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at OrchardCore.Diagnostics.DiagnosticsStartupFilter.<>c__DisplayClass3_0.<<Configure>b__1>d.MoveNext() in C:\projects\orchardcore\src\OrchardCore.Modules\OrchardCore.Diagnostics\DiagnosticsStartupFilter.cs:line 36
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at OrchardCore.ContentPreview.PreviewStartupFilter.<>c.<<Configure>b__1_1>d.MoveNext() in C:\projects\orchardcore\src\OrchardCore.Modules\OrchardCore.ContentPreview\PreviewStartupFilter.cs:line 23
--- End of stack trace from previous location where exception was thrown ---
   at OrchardCore.Modules.ModularTenantRouterMiddleware.Invoke(HttpContext httpContext) in C:\projects\orchardcore\src\OrchardCore\OrchardCore\Modules\ModularTenantRouterMiddleware.cs:line 63
   at OrchardCore.Environment.Shell.Scope.ShellScope.UsingAsync(Func`2 execute) in C:\projects\orchardcore\src\OrchardCore\OrchardCore.Abstractions\Shell\Scope\ShellScope.cs:line 206
   at OrchardCore.Modules.ModularTenantContainerMiddleware.Invoke(HttpContext httpContext) in C:\projects\orchardcore\src\OrchardCore\OrchardCore\Modules\ModularTenantContainerMiddleware.cs:line 59
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

@DrewBrasher
Copy link
Contributor Author

For the test project, I got it to run by adding this to the .csproj file:
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />

image

I'm not sure why it would need that now if it didn't need it before though.

@DrewBrasher
Copy link
Contributor Author

I got past the Unable to resolve service for type 'OrchardCore.Workflows.Services.IWorkflowManager' error by enabling the Workflow feature in the configuration menu. now I get another error when adding an item to cart. I will look into it more tomorrow but here is the error:

System.ArgumentNullException: Value cannot be null. (Parameter 'key')
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at Money.CurrencyProvider.GetCurrency(String isoSymbol) in C:\Working\OrchardCore.Commerce\MoneyDataType\CurrencyProvider.cs:line 20
   at Money.Currency.FromISOCode(String code, IEnumerable`1 providers) in C:\Working\OrchardCore.Commerce\MoneyDataType\Currency.extra.cs:line 137
   at OrchardCore.Commerce.Settings.CommerceSettingsCurrencySelector.get_CurrentDisplayCurrency() in C:\Working\OrchardCore.Commerce\OrchardCore.Commerce\Settings\CommerceSettingsCurrencySelector.cs:line 16
   at OrchardCore.Commerce.Services.MoneyService.get_CurrentDisplayCurrency() in C:\Working\OrchardCore.Commerce\OrchardCore.Commerce\Services\MoneyService.cs:line 52
   at OrchardCore.Commerce.Services.PriceProvider.<>c__DisplayClass5_0.<AddPrices>b__3(PricePart pricePart) in C:\Working\OrchardCore.Commerce\OrchardCore.Commerce\Services\PriceProvider.cs:line 41

@bleroy
Copy link
Member

bleroy commented Aug 19, 2020

I can take care of the add to cart errors, they look unrelated to your changes.

@DrewBrasher
Copy link
Contributor Author

Do you want me to add the Microsoft.NET.Test.Sdk package to the test project?

@bleroy
Copy link
Member

bleroy commented Aug 19, 2020

No, I'll take care of that as well, thanks. I thought you'd only need the xunit test adapter package, I need to check what's going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants