Jump to content

VS 2022 Template for .NET 5.0


Go to solution Solved by AndrewDavid,

Recommended Posts

2 hours ago, Ego Eram Reputo said:

That way you can make changes and additions directly to the document.

 

🙈

 

@Ego Eram Reputo and @AndrewDavid, rather than making direct edits, I suggest doing this instead:

https://www.howtogeek.com/398789/how-to-suggest-an-edit-in-google-docs/

  • Like 1

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

Still need help. Step D6 in the walkthrough, "Double click on the file named EffectPluginConfigDialog.cs in the Solution Explorer window.

 

cCYHTx.md.png

Unable to build due to errors in EffectPlugin.cs

 

Line 42
           : base(EffectPlugin.StaticName, EffectPlugin.StaticImage, EffectPlugin.StaticSubMenuName, EffectFlags.Configurable)
    EffectFlags.Configurable => new EffectOptions() { Flags = EffectFlags.Configurable }

 

If I change to 

 

Solution1
           : base(EffectPlugin.StaticName, EffectPlugin.StaticImage, EffectPlugin.StaticSubMenuName,new EffectOptions() { Flags = EffectFlags.Configurable })

It does not resolve the error.

Tells me to add reference to System.Drawing.Common

 

When I do that, I just get another error on Line 30

       public static Bitmap StaticImage { get { return Properties.Resources.Icon; } }

 

"Bitmap" exists in 2 References 

System.Drawing

System.Drawing.Common

 

If I remove 1 - well you know how it goes - more errors.

 

Could it be its because I am referencing net 4.8 instead of the 4.6 mentioned in the walkthrough (I don't really think so)

 

 

 

 

 

 

 

 

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

You should really use the project file proposed by @toe_head2001

It contains all standard references you typically need in en effect plugin.

A resource file can be added via the properties of the project. There you can add icons and more. This will also create the right namespace you can reference in your source.

Start the project from scratch add the required features and export it as template.

Don't mix references. Use net 5.0.

  • Upvote 1

midoras signature.gif

Link to comment
Share on other sites

9 hours ago, midora said:

Start the project from scratch add the required features and export it as template.

Don't mix references. Use net 5.0.

OK - So I took your suggestion and started at square One. However I still have a few issues.

Of course I posted the project to GitHub for your perusal.

https://github.com/AndrewDavid007/2022Template

 

First of all, when I started the create new project, I selected;

Windows Forms Class Library (C# / Windows / Desktop / Library)

Was that correct?

 

When using the code from the original template, I still had the same errors. Rather than trying to debug them, I just left the EffectPlugin.cs blank

This allowed me to get successful builds after adding addition items. I did a lot of copy and paste to build the solution. The interface is different now in Net 5.0.

I could not find where to link it to the executable. It prompted me to add it as a project to the solution and make it the startup project. There has to be another way, adding Paint.Net as a project seemed strange. I wouldn't even know how to do that. I was able to link the project to the executable through the debug settings before.

 

I did export the project as a template though. Its just missing all that code from EffectPlugin.cs

Talk about a learning curve, I just need to learn how to code. But that's another project.

 

 

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

5 hours ago, AndrewDavid said:

I did export the project as a template though. ... Talk about a learning curve, I just need to learn how to code. But that's another project.

 

No offense intended, but don't you think you're "putting the cart before the horse" ?

 

If you sincerely want to learn, I recommend reviewing the fundamentals.

You've been asking extremely basic questions.  While we like to help, we are not tutors here to help you with each baby step.

 

Having said that, I hope you continue to learn.  For the time being, I would advise you to forget about Visual Studio, and instead focus on learning to code within CodeLab.  That's where you'll benefit the most.

 

4 hours ago, AndrewDavid said:

Now about that Debug error concerning linking the executable. Entering new territory now.

 

I already answered this question for you last week.  Here are instructions again.

https://forums.getpaint.net/topic/4209-how-to-debug-your-plugin/

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

21 minutes ago, toe_head2001 said:

No offense intended

None taken.

 

22 minutes ago, toe_head2001 said:

Codelab. 

Not available yet  for my installation.

 

23 minutes ago, toe_head2001 said:

Here are instructions again.

Yes they worked fine in VS2019. Totally different screens in VS2022(Preview)

image.png.c06de8bc2fd47ca22c7d486e54eda455.png

Before you learn to bake- you have to learn how to use an oven 😊

 

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

45 minutes ago, AndrewDavid said:

Totally different screens in VS2022(Preview)

 

In the 'Launch Profiles' dialog, click on the third icon (the red one).  Then click on the top-left icon (the yellow one), and select Executable.  Now you have the correct stuff.

  • Thanks 1

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

  • AndrewDavid changed the title to 2022 Template for Net 5.0
  • AndrewDavid changed the title to VS 2022 Template for .NET 5.0

Sorry, I don't have time to go into details until later tonight, but there are quite a few issues with your template.

 

I not sure what your goal with all this is.  Are you just trying to learn how Visual Studio projects work?

 

I've already said I will release an update to my templates when Paint.NET v4.3 is released.  It's too early now; there's not even a v4.3 beta yet.

  • Like 1

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

I just love free software 😊

Just think or it as my contribution to the community. It may not be perfect, but its a giant step for me. Now that I have the v4.3 Alpha installed , I needed a working template to learn more about creating plugins. Until I read that walkthrough, I wouldn't of had a clue about creating forms. You can only do the "Hello World" so many times. Microsoft does a great job describing the C# Language but I'm only interested in building libraries for Paint.NET. Don' expect anything soon though. 

 

PS I won't mention the absence of codelab.

Edited by AndrewDavid

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

  • 2 years later...

@BoltBait @toe_head2001 @Ego Eram Reputo @Rick Brewster @Pixey @MJW @AnneYusual

 

After all the change in the IT industry over the past two years (and lots of practice) I have for you a working template that generates a non functioning plugin.

 

It does nothing more than render the UI due to the fact I used an old plugin with some obsolete code.

 

The most important thing to me is getting the Template to work without errors for new users that had the same learning curve I followed.

It is built on the current 5.0.11  Paint.Net  release.

 

The code was derived from @MJW 's long forgotten color wheel. Hope he doesn't mind.

 

PaintDotNetTemplateEffect2023.zip

 

I will post it here for now for everyone to review it. I can focus on the User Guide Document that is 80% complete.

I think when I have the Document complete, I can generate a new post with the template and guide together.

Hope this helps :)

 

 

 

 

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

@Rick Brewster I can regenerate and post easily. Lets wait for any more errors discovered. Tomorrow noon should be time enough. This is kind of a sneak peak.

It needs a New thread with the User guide or do we keep it here?

 

btw you spelled Template wrong 😬 Not anymore :)     image.png.c8919dd7fadfdbb5b0d21eb6b0391b09.png

Check here for the new Template Walkthrough coming soon.   TemplateButton.png.371ab4ab8b3c8b08a5ffe5aad570ee99.png

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...