Jump to content

VS 2022 Template for .NET 5.0


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
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)

 

 

 

 

 

 

 

 

Signature2018.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.

 

 

Signature2018.png

 

Link to comment
Share on other sites

1 hour ago, AndrewDavid said:

Rather than trying to debug them, I just left the EffectPlugin.cs blank

Eureka - I solved it. Just don't ask me how. :)

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

image.png.dae6291b928bff8ea4ac5d0635dc8c08.png

 

Signature2018.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/

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¬†ūüėä

 

Signature2018.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
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
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

Signature2018.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.

 Share

×
×
  • Create New...