dwmkerr / sharpgl

Use OpenGL in .NET applications. SharpGL wraps all modern OpenGL features and offers a powerful scene graph to aid development.
MIT License
755 stars 299 forks source link

Visual studio2015 extensions #91

Closed robinsedlaczek closed 9 years ago

robinsedlaczek commented 9 years ago

Hey Dave!

Please find the first approach for the VS 2015 extensions in this PR. The extensions are working in VS 2015 as you can see in the screenshot below. but it's not finished yet of course. Please consider the following points when reviewing my PR. These points includes points to discuss, too:

  1. Ignore/don't merge the commits in the Seeds solution. For the first try, I updated the seed projects to VS 2015, removed all dependencies and add the SharpGL 2.4 NuGet packages. Then I used this clean new VS 2015 projects to export the project templates as zip files.
  2. I created a new solution for the VS 2015 extensions named SharpGL.2015. In this project I added this zip files from point 1 as the project templates for WinForms and WPF. This seems a little bit more easy to me than your approach with the template projects within the extensions solution. I did not get the process how to come from the seed project templates to those template projects that are in the extension solution (as you did for 2010 and 2012/13). I cannot see any advantage in doing so except that the template project files are targeted to that VS version for which the extension solution was created. Please correct me if I am wrong!
  3. We need to write down the process of creating extensions for new VS versions. :)
  4. As mentioned in point 1, I used the Seeds solution directly to create the project templates. I removed every hard dependency and added SharpGL 2.4 NuGet packages to the template projects. When installing the extensions in VS 2015 and then creating projects based on the templates, all NuGet packages are restored during first build and the applications are running well (please see the screenshot below).
  5. Names and versions. Which names and descriptions for project templates, extension etc. should I implement? Is it documented somewhere? If not, we should write it down. Looking into the projects is hard if you not know where to look. Same to versions.

Ok, that's all for the first time. Looking forward to your feedback!

extensions

extensions 2

extensions 3

dwmkerr commented 9 years ago

Hi Robin, looks good! I think you'll need to merge from v2.5 again to let the PR be merged as I've removed the same OpenGL constant as you.

The only two things I'm not sure about are:

  1. Do we need a 2015 version of the project as well as a 2013 version? Can we not just use the 2015 version and target the vsix to 2012, 2013 and 2015? That would essentially mean taking the existing project and upgrading it. Then we manage only one extension project.
  2. With the zips, do you create them by exporting the seed project as a template? If that works it sounds easier than me managing the project templates by hands indeed.
robinsedlaczek commented 9 years ago

So, new version in PR!

  1. I just tried to set the version range to Visual Studio 2012 - Visual Studio 2015. Hope that works. Dave, can you test it for VS 2012 somehow? For VS2015 it works. I'll test it for VS2013, too. If it works for the targeted versions of VS, we can go back to one extension project.
  2. Yes, I created the ZIPs by exporting the templates from the seeds directly in Visual Studio. And it works. Further, it works with the NuGet packages. Means, create a new project based on the templates, compile and run. VS will download all required NuGet packages during build.
dwmkerr commented 9 years ago

Hi Robin,

I'll be looking at this soon, just installing VS 2015 on a VM. Sounds like the trick with the zips really helps, it's going to make it much easier to maintain

robinsedlaczek commented 9 years ago

Hey Dave! Ok, cool! Looking forward to your test results! :) We have to change the caption, because when installing in VS2013 there is "SharpGL Extensions for Visual Studio 2015" shown as caption. So I'll remove the "for Visual Studio 2015". Tests with VS2013 were successful.

Date: Tue, 10 Feb 2015 05:15:04 -0800 From: notifications@github.com To: sharpgl@noreply.github.com CC: robin.sedlaczek@live.de Subject: Re: [sharpgl] Visual studio2015 extensions (#91)

Hi Robin,

I'll be looking at this soon, just installing VS 2015 on a VM. Sounds like the trick with the zips really helps, it's going to make it much easier to maintain

— Reply to this email directly or view it on GitHub.

robinsedlaczek commented 9 years ago

I removed "2015" from the product name since it does not look good if you are in VS2013.

dwmkerr commented 9 years ago

Hi Robin,

When I install the vsix extensions and build in Visual Studio 2012 it fails to find the SharpGL extensions. I think this is because for vsix packages you do have to include the nuget packages in the vsix (you can see the original extensions project for this). I'm not actually sure if it's possible to tell the vsix to use Nuget package restore.

You might be able to do this by simply taking the extensions project that I wrote, opening it in 2015 (which will ask you to upgrade), then change the vspackage in that original solution which has been upgraded (this also means the package ID will be the same which we'll need to ensure to allow existing users to upgrade). You could try doing some research on nuget packages in solutions but I found no way to avoid including them, see:

https://github.com/dwmkerr/sharpgl/blob/master/extensions/SharpGL/WinformsTemplateProject/WinformsTemplateProject.vstemplate#L38

This means we may not be able to use the zip files method (unless you can get package restore working!)

robinsedlaczek commented 9 years ago

Hi Dave,

What do you mean with the following sentence?

When I install the vsix extensions and build in Visual Studio 2012 it fails to find the SharpGL extensions.

You first install the vsix and then build what exactly? So after installing the vsix, the extensions are not available in VS2012?

So we have a problem in VS2012 only, correct? I’ve tested it for VS 2013 and VS 2015 and it works including NuGet package restore.

Delivering one vsix for VS 2012 and one for 2013/15 is no option, correct?

In my opinion, VS2012 is too old for this kind of NuGet package restore…

Robin


Robin Sedlaczek

Wave Developments / The Berlin Microsoft Connection

Warschauer Strasse 60

10243 Berlin

Germany

Twitter https://twitter.com/RobinSedlaczek https://twitter.com/RobinSedlaczek

Wordpress http://robinsedlaczek.wordpress.com/ http://robinsedlaczek.wordpress.com/

Facebook https://www.facebook.com/TheBerlinMicrosoftConnection https://www.facebook.com/TheBerlinMicrosoftConnection

LinkedIn http://de.linkedin.com/pub/robin-sedlaczek/34/6a6/222/ http://de.linkedin.com/pub/robin-sedlaczek/34/6a6/222/

Xing https://www.xing.com/profile/robin_sedlaczek https://www.xing.com/profile/robin_sedlaczek

From: Dave Kerr [mailto:notifications@github.com] Sent: Saturday, February 14, 2015 4:35 AM To: dwmkerr/sharpgl Cc: Robin Sedlaczek Subject: Re: [sharpgl] Visual studio2015 extensions (#91)

Hi Robin,

When I install the vsix extensions and build in Visual Studio 2012 it fails to find the SharpGL extensions. I think this is because for vsix packages you do have to include the nuget packages in the vsix (you can see the original extensions project for this). I'm not actually sure if it's possible to tell the vsix to use Nuget package restore.

You might be able to do this by simply taking the extensions project that I wrote, opening it in 2015 (which will ask you to upgrade), then change the vspackage in that original solution which has been upgraded (this also means the package ID will be the same which we'll need to ensure to allow existing users to upgrade). You could try doing some research on nuget packages in solutions but I found no way to avoid including them, see:

https://github.com/dwmkerr/sharpgl/blob/master/extensions/SharpGL/WinformsTemplateProject/WinformsTemplateProject.vstemplate#L38

This means we may not be able to use the zip files method (unless you can get package restore working!)

— Reply to this email directly or view it on GitHub https://github.com/dwmkerr/sharpgl/pull/91#issuecomment-74359689 . https://github.com/notifications/beacon/ACxBAJS0oTCM_AY420Cf9sI-OieCVRUDks5nrrnKgaJpZM4DbjyY.gif

robinsedlaczek commented 9 years ago

What should we do with the PowerShell execution policy? Our build scripts for the extensions are not signed. So I need to set the execution policy to at least "RemoteSigned" (https://technet.microsoft.com/library/hh847748.aspx). Is that a problem?

Yes, I can reset the policy to Restricted or AllSigned after running the script. But wouldn't signing the scripts be cooler? Or does it not relate to the costs..?

dwmkerr commented 9 years ago

With respects to the powershell scripts I wouldn't worry about signing them, it is a bit of a hassle and very few users will need to run them (pretty much only those who are going to be physically releasing the extensions)

robinsedlaczek commented 9 years ago

I upgrade the extensions in that way, you proposed, Dave. But I currently have a problem to test the PowerShell scripts since I do not have a VS2012 version installed. And it's a problem to find an installer this time. Can you please be so kind to test the PowerShell scripts? I try to solve my problem but maybe you are a bit faster.

The VSIX packages could be installed on my machine for VS2015. Templates works as expected.

dwmkerr commented 9 years ago

Hi Robin, no problems - I'll test the powershell scripts tomorrow morning (I've got a machine with VS 2012, 2013 and 2015 on, I'll run the tests on that!)

robinsedlaczek commented 9 years ago

Ok, I installed 2012 and the extensions and the build scripts are fine. They work for me. ;)

dwmkerr commented 9 years ago

Great, I'll run a test as well and then merge it, then let's do another release.

dwmkerr commented 9 years ago

OK I'm working on the tests now, having a few issues but I think they're easy to solve. Basically I'm getting this error:

C:\Repositories\GitHub\dwmkerr\sharpgl\extensions\SharpGL\SharpGL\SharpGL.csproj(97,3): error MSB4019: The imported pro
ject "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.targets" was not found. Confirm
 that the path in the <Import> declaration is correct, and that the file exists on disk.
C:\Repositories\GitHub\dwmkerr\sharpgl\extensions\SharpGL\WinformsTemplateProject\WinformsTemplateProject.csproj(105,3)
: error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSD
K.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on dis
k.
C:\Repositories\GitHub\dwmkerr\sharpgl\extensions\SharpGL\WpfTemplateProject\WpfTemplateProject.csproj(120,3): error MS
B4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.targets"
 was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

Which I think means it's trying to build the extension projects using v11. I'm going to open the projects and see if I can explicitly target them to v14 which should mean everything will build just with VS2015 and the VS2015 SDK installed.

Also in preparation for the merge you can delete the SharpGL.2015 but don't forget to put your name in the SharpGL project!

dwmkerr commented 9 years ago

OK I found the issue, in BuildSharpGLExtensions.ps1 script:

. $msbuild $solutionExtensions /p:Configuration=Release /verbosity:quiet /p:VisualStudioVersion=14.0

fixes the issue - from the commandline explictly building with VS2015 makes it work even if VS2015 and the VS2015 SDK is the only thing installed. Without that it may try and use other versions of the SDK. Now that I've got it building I can test in each version and make sure it still uploads to the gallery (an absolute pain because of this issue which is why we have all the extra vsix tools steps!)

dwmkerr commented 9 years ago

OK it works great, please just update the powershell script to use v14, add your name to the credits for extension project and delete the SharpGL.2015 one, then I will merge and release 2.5

robinsedlaczek commented 9 years ago

Hey Dave! Yes, build targets were missing at my machine, too. So I know the errors you have. That's why I installed VS2012 and the VS2012 SDK. Than, the scripts work. I was thinking, that we need 2012 and the SDK with the build targets in order to build the package for this version? So please tell me what you have done to make VS2015 SDK being the only prerequisite for building the extensions. Where should I put my name in the SharpGL project? Yes, I'll delete the SharpGL.2015 project. Coming in some minutes. Robin

___Robin SedlaczekWave Developments / The Berlin Microsoft Connection Warschauer Strasse 6010243 BerlinGermany Twitter https://twitter.com/RobinSedlaczekWordpress http://robinsedlaczek.wordpress.com/Facebook https://www.facebook.com/TheBerlinMicrosoftConnectionLinkedIn http://de.linkedin.com/pub/robin-sedlaczek/34/6a6/222/Xing https://www.xing.com/profile/Robin_Sedlaczek

Date: Sun, 1 Mar 2015 03:48:41 -0800 From: notifications@github.com To: sharpgl@noreply.github.com CC: robin.sedlaczek@live.de Subject: Re: [sharpgl] Visual studio2015 extensions (#91)

OK I'm working on the tests now, having a few issues but I think they're easy to solve. Basically I'm getting this error:

C:\Repositories\GitHub\dwmkerr\sharpgl\extensions\SharpGL\SharpGL\SharpGL.csproj(97,3): error MSB4019: The imported pro ject "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. C:\Repositories\GitHub\dwmkerr\sharpgl\extensions\SharpGL\WinformsTemplateProject\WinformsTemplateProject.csproj(105,3) : error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSD K.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on dis k. C:\Repositories\GitHub\dwmkerr\sharpgl\extensions\SharpGL\WpfTemplateProject\WpfTemplateProject.csproj(120,3): error MS B4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Which I think means it's trying to build the extension projects using v11. I'm going to open the projects and see if I can explicitly target them to v14 which should mean everything will build just with VS2015 and the VS2015 SDK installed.

Also in preparation for the merge you can delete the SharpGL.2015 but don't forget to put your name in the SharpGL project!

— Reply to this email directly or view it on GitHub.

robinsedlaczek commented 9 years ago

Ah, cool thing! :) So my VS2012 installation was not really needed.... :/ Thx for your help, Dave! Robin

___Robin SedlaczekWave Developments / The Berlin Microsoft Connection Warschauer Strasse 6010243 BerlinGermany Twitter https://twitter.com/RobinSedlaczekWordpress http://robinsedlaczek.wordpress.com/Facebook https://www.facebook.com/TheBerlinMicrosoftConnectionLinkedIn http://de.linkedin.com/pub/robin-sedlaczek/34/6a6/222/Xing https://www.xing.com/profile/Robin_Sedlaczek

Date: Sun, 1 Mar 2015 03:57:57 -0800 From: notifications@github.com To: sharpgl@noreply.github.com CC: robin.sedlaczek@live.de Subject: Re: [sharpgl] Visual studio2015 extensions (#91)

OK I found the issue, in BuildSharpGLExtensions.ps1 script:

. $msbuild $solutionExtensions /p:Configuration=Release /verbosity:quiet /p:VisualStudioVersion=14.0

fixes the issue - from the commandline explictly building with VS2015 makes it work even if VS2015 and the VS2015 SDK is the only thing installed. Without that it may try and use other versions of the SDK. Now that I've got it building I can test in each version and make sure it still uploads to the gallery (an absolute pain because of this issue which is why we have all the extra vsix tools steps!)

— Reply to this email directly or view it on GitHub.

robinsedlaczek commented 9 years ago

Hey Dave! It's done. But where to put the credit information? I've added my name to the authors of the extension package. Is it this, what you mean?

dwmkerr commented 9 years ago

That's what I mean indeed, glad that the script change works for you too, I was scratching my head on that one for a while! I'll merge shortly :)

dwmkerr commented 9 years ago

Awesome work, thanks for this Robin!

robinsedlaczek commented 9 years ago

Great! :)

Von meinem Windows Phone gesendet


Von: Dave Kerrmailto:notifications@github.com Gesendet: ‎01.‎03.‎2015 21:37 An: dwmkerr/sharpglmailto:sharpgl@noreply.github.com Cc: Robin Sedlaczekmailto:robin.sedlaczek@live.de Betreff: Re: [sharpgl] Visual studio2015 extensions (#91)

Merged #91.


Reply to this email directly or view it on GitHub: https://github.com/dwmkerr/sharpgl/pull/91#event-244028391