blipson89 / Synthesis

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

Regenerate Now button goes to notfound page #101

Closed ArulPushpam closed 2 years ago

ArulPushpam commented 3 years ago

I am getting this bug in my local.

Whenever I try to generate the synthesis model it's going to notfound page

It should generate the model

Sitecore - 10.1 , Synthesis - 9.1.4

i have attached the images for your reference. I am getting the access denied issue also but i gave all the access to the folder image image

blipson89 commented 3 years ago

Hi @ArulPushpam,

A couple possible things come to mind:

  1. Are you using IdentityServer? If so, please make sure you have this config file deployed: Synthesis.ControlPane.IdentityServer.config
  2. Based off the message "Access to the path 'Feature\Events\code' is denied", where does your source code live? I would expect this to be an absolute path with the drive letter included, unless your source code lives inside the webroot.
ArulPushpam commented 3 years ago

Hi @blipson89,

Thank you so much for your response. 1) I checked the identity server config it was disabled. 2)I'm maintaining the code outside of webroot.'Feature\Events\code is coming from my code path.

is there any suggestion for resolving the issue?

blipson89 commented 3 years ago

Are you using Identity Server? If so, you need that config file to not be disabled.

If you're using a helix-based architect, you're going to want to use the SynthesisConfigurationRegistration pattern for registering modules.

There's an example here: https://github.com/kamsar/Habitat/tree/HabitatSynthesis/src/Foundation/Synthesis/code

please note: do NOT use abstract for these. The example above has the abstract keyword... just remove that and the rest should work.

ArulPushpam commented 3 years ago

@blipson89 I have enabled the Synthesis.ControlPane.IdentityServer.config file. I am using helix architect and registered all the models and I used these codes for building the synthesis my local. Still I'm facing the issue image image image

blipson89 commented 3 years ago

What's your Synthesis.ModelOutputBasePath set to in the ShowConfig.aspx?

ArulPushpam commented 3 years ago

@blipson89 The value is empty. should I fill anything in the value attribute? image

blipson89 commented 3 years ago

It depends on the structure of your codebase.

For example, if your model files are located here:

C:\projects\MYPROJECT\src\Feature\Events\code\Synthesis.Model.cs

You would want Synthesis.ModelOutputBasePath to be C:\projects\MYPROJECT\src

ArulPushpam commented 3 years ago

Hi @blipson89 I added the path image Now,I'm facing this error image

blipson89 commented 3 years ago

What's the value of ModelOutputFilePath in your SynthesisConfigurationRegistration class?

See line 22: from the example

ArulPushpam commented 3 years ago

@blipson89 Actually Synthesis.Model.cs files are generated in my folder. but it's showing the error after done the task image image

Do you have any idea about it?

blipson89 commented 3 years ago

Check all of your modules - did a Synthesis.Model.cs file get generated for all of them, or is there one Helix module that doesn't have one?

ArulPushpam commented 3 years ago

@blipson89 image I checked i have only two modules and synthesis created for those two. but I am not aware about the default configuration

blipson89 commented 3 years ago

Can you please attach your Synthesis.config file and any custom Synthesis-related config files you have?

You can replace any sensitive information with "REDACTED" or something to that effect, if you want.

ArulPushpam commented 3 years ago

synthesis-config.txt

ArulPushpam commented 3 years ago

@blipson89 I have attached my config file here. please have a look, I don't have any custom files.

blipson89 commented 3 years ago

The <processor type="Synthesis.Pipelines.Initialize.SynthesisConfigRegistrar, Synthesis"> doesn't appear to have any custom assemblies listed.

For a Helix-based architecture, you should be creating custom SynthesisConfigurationRegistration classes and adding the assemblies to this list.

Please follow the steps listed in the README: I'm using modular architecture. Will synthesis support models across projects? and look at the Synthesis Habitat example implementation to make sure that your solution is setup correctly.

Please don't forget what I mentioned yesterday:

please note: do NOT use abstract for these. The example above has the abstract keyword... just remove that and the rest should work.

Let me know if following those steps and setting up the custom registrations solves your issue.

ArulPushpam commented 3 years ago

@blipson89 I have removed the abstract keyword from https://github.com/kamsar/Habitat/blob/HabitatSynthesis/src/Foundation/Synthesis/code/HabitatModelRegistration.cs this class name. I have a doubt that should I remove the abstract keyword from all the model registration classes and property?

blipson89 commented 2 years ago

You can try leaving abstract there if you want, but somebody once reported an issue with it present.

Did you already have this class in your solution?

ArulPushpam commented 2 years ago

I have tried with removed the abstract but it's not worked out. This is my synthesis code file https://github.com/ArulPushpam/Sitecore-Synthesis/tree/master/code

I have registered all the modules using the below config public class ModelRegistration : FeatureModelRegistration { } public class ModelRegistration : FoundationModelRegistration { }

ArulPushpam commented 2 years ago

@blipson89 Finally my only issue is image The synthesis model is generating properly.but I don't have any idea about this issue.

blipson89 commented 2 years ago

The error is still "The given path's format is not supported"?

in the ShowConfig.aspx, look for <sc.variable name="sourceFolder". The value should be C:\Learning\SitecoreCode\Sitecon\src.

if you don't have this, add it right under the <sitecore> node of Sitecon.Foundation.Synthesis.config (after line 2)

<configuration>
    <sitecore>
        <sc.variable name="sourceFolder" value="C:\Learning\SitecoreCode\Sitecon\src" />
...
ArulPushpam commented 2 years ago

@blipson89 Changed everything.still I can generate the model but I am facing the error image

image

image

image

blipson89 commented 2 years ago

What path is Synthesis.config in your webroot? is it /App_Config/Include/Synthesis/Synthesis.config?

move Sitecon.Foundation.Synthesis.config to the following folder:

/App_Config/Include/zFoundation/Sitecon.Foundation.Synthesis

note i wrote zFoundation, not Foundation

ArulPushpam commented 2 years ago

image

Finally Successful !!!!. Thank you so much for your help @blipson89 . I'm very happy about our progress and result.could you please let me know why should we need to use zFoundation?

blipson89 commented 2 years ago

awesome! glad to hear it 😄

If you go to Synthesis.aspx now, you likely won't see "Default Configuration" listed anymore. The zFoundation was because the <patch:delete/> in Sitecon.Foundation.Synthesis.config (Lines 45-47) was being called before Synthesis.config, so it wasn't finding anything to delete.