blipson89 / Synthesis

Synthesis is a universal object mapper for Sitecore
MIT License
75 stars 25 forks source link

Can't keep customer or partner name in naming helix projects (project namespace) as Synthesis.model.cs throws error #88

Closed PaulsonM closed 4 years ago

PaulsonM commented 4 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? Building solution fails due to error in Synthesis,model.cs

If the current behavior is a bug, please provide the steps to reproduce.

  1. For e.g. Keep the project name as "MyCustomerName.Feature.Maps"
  2. Configure Synthesis
  3. Build solution
  4. Error in Sitecore namespace wherever its subclasses are used (see attached error screenshot)

What is the expected behavior? Synthesis,model.cs should build successfully without error

Please mention your Sitecore version and Synthesis version. Sitecore 9.3 & Synthesis 9.1.0.2

image

PaulsonM commented 4 years ago

Example of some Sitecore classes where errors are thrown

image

image

PaulsonM commented 4 years ago

These error were also thrown in my cs classes, but I added namespace "using Sitecore;" or by adding alias.. But since Synthesis.model.cs is an auto-generated class how to resolve this and get my build successful..?!

Am I'm missing something here..

blipson89 commented 4 years ago

@PaulsonMac based off where the red squiggly lines are, it looks like whatever csproj the Synthesis.Model.cs file is in is missing a reference to Sitecore.Kernel and Sitecore.ContentSearch.

PaulsonM commented 4 years ago

Thanks very much for your reply :) I already tried adding Sitecore.Kernel and Sitecore.ContentSearch as a reference to that project, but it is not adding these references but VS simply throws the below error :

image

PaulsonM commented 4 years ago

I also tried adding Sitecore.Kernel and Sitecore.ContentSearch as a nuget package, but same error persists

royvou commented 4 years ago

Is it possible you use "sitecore" in your namespace?

PaulsonM commented 4 years ago

I can try to consider adding "Sitecore.xyz.xyz" as my project name. But before considering, I want to know whether it is not possible to use Synthesis unless we have "Sitecore." at the beginning of the namespace/project name..? If there is no other solution to fix this issue, then I can try considering it..

PaulsonM commented 4 years ago

But having "Sitecore." in my namespace always fixes the error. As described in this issue name, I'm not able to keep Customer/Partner name in the beginning of the namespace

blipson89 commented 4 years ago

hey @PaulsonMac - I ping'd you on Sitecore slack a few days ago asking for a bit more information in a DM

PaulsonM commented 4 years ago

Hi Ben! I'm sorry.. this issue was fixed by my team leader. I wanted to close this issue then, but was quite busy.. I think I missed renaming the project name in some place.. So, this issue is fixed for me..