Inhalte aufrufen

Profilbild

how to debug a plugin


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
2 Antworten zu diesem Thema

#1 LordOfGames

LordOfGames

    Newbie

  • Members
  • Punkt
  • 2 Beiträge

Geschrieben: 12 October 2019 - 18:27

I created a custom plugin, can you show me the way to debug quickly?
 
Is it possible to test the plugin without having to upload it to the admin area?
 
Thanks for the reply


#2 Marcel Schmidt

Marcel Schmidt

    SmartStore AG

  • Administrators
  • 149 Beiträge

Geschrieben: 14 October 2019 - 12:02

Hi,

 

just to clearify your position, you

 

1. have a stable dev-branch (3.2) fork

2. are working in visual studio 17+

3. created your plugin within the solution as new project

4. have set up your plugin

 

You can add Breakpoints to your code and debug as any other programm in vs

When debugging your programm (f5), a new browser window opens with your smartstore instance, go to Admin > Plugin > [Your Plugin]

Your plugin should be displayed if your it is correctly set up

 

 

Best regards



#3 LarryL

LarryL

    Newbie

  • Members
  • Punkt
  • 4 Beiträge

Geschrieben: 08 November 2019 - 07:49

As Marcel pointed out, the key is to add your plugin as part of the solution. However, I do want to point out that most plugin projects will likely depend on the SmartStore.Web project, so that being the case you won't be able to set the plugin as a dependency of the Web project (VS will warn about circular reference). As such, it is important that you manually build the plugin and make sure its build output goes into the Plugins folder of the Web project (see other plugin project build settings on how to do this) before every debug run. Once your plugin files are correctly copied or updated, run the Web project in Debug mode and you will see your plugin being already available for install - no upload is necessary. Hope this clarifies.