more G-Labs products

Author Topic: Recommended Development Environment  (Read 4971 times)

January 15, 2015, 10:13:21 PM
Read 4971 times

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi all,

did a lot of reading this evening and wondering what Visual Studio version is used by the gurus.
Simply could not find it...

I used VS2010 because I like it and I saw it mentioned at the forum.
I had to change <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> it was 4.5
This indicates vs2013
I had to install MSBuild2013 before the project builds.
Maybe this is also an indication for VS2013

Well I could be wrong (shit happens), are you all using VS2013?

Best regards,
Wibo.


January 15, 2015, 11:18:22 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
HG VS solution file is built with VS2013.
There's a community edition available:

http://www.visualstudio.com/it-it/downloads/download-visual-studio-vs#d-community

Cheers,
g.

January 15, 2015, 11:27:40 PM
Reply #2

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Here's an English version of the page for those that don't speak Italian.   ;D

http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#d-community

January 16, 2015, 08:10:55 AM
Reply #3

NicoVermeir

  • ****
  • Information
  • Sr. Member
  • Posts: 122
    • My blog
Visual Studio 2013 here (both for the win phone app and HG solution). together with ReSharper, it's the ultimate dev tool :)

January 16, 2015, 06:43:30 PM
Reply #4

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi all,

thanks again for all the help I get.

Untill now I've been hacking my way in, time to create a clean vmware and install the same tools.

Downloading VS2013 Community...
and of course I want resharper, so downloading v9

I'll be busy for some time...

regards,
Wibo.

January 16, 2015, 07:24:18 PM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I've been using VS2010 express with some success recently.  I started installing VS2013 Community yesterday before I realized how big a download it was.  I'll try again and just grab the ISO this time.  Resharper v9, sounds good.

January 18, 2015, 10:33:57 PM
Reply #6

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi bkenobi,

I'm making a new dev environment for HG based on a fresh win7 install.
Since this is not something I'm planning to do often, It could be good idea to write some sort of a tutorial about what I did to get it working (Unique chance, a newbie writing a tutorial).

The plan is to write something for less experienced programmers...
Please let me know if there is any need for this, because it takes a lot of extra time.

Regards,
Wibo.

January 19, 2015, 04:52:41 PM
Reply #7

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Tutorials are never bad!

January 19, 2015, 09:30:01 PM
Reply #8

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi all,

Here's a draft of my tutorial, colleagues tell me I have a typical style.

Just let me know if this is usefull.

regards,
Wibo.


January 19, 2015, 09:30:32 PM
Reply #9

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi all,

To me it seems a good idea to post the complete setup since I'm setting it up from scratch.
Already could compile, debug and run HG on windows, but a lot of hacking was needed.

You need to know that I develop(and hack) in virtual machines using VMware workstation 10.
I really like to blow up a vm without compromizing the host.

I'm targetting this report on people that have basic knowledge of Windows, Visual studio and Svn.

Here we go!

Took a vmware that only has a fresh Win7pro 32bit installed, it's a lean and mean win7, all eyecandy is disabled.

Integrated development environment (Obviously you need a compiler)

Installed VisualStudio 2013 Community.
It's free, it doesn't seem to have the limitations of the express edition.
Totally missed the announcment in november last year, but this is a big improvement for developpers.
There are not many configuration options during setup, so this part is very hard to screw up.

Version control (you need this to get the source files and view history)

Installed TortoiseSVN 1.8.10
It's free and the setup is really easy, just download the right (32/64) version for your os.

Integrated version control for Visual Studio (You can do without it, but I think it's handy)

Installed AnkhSvn 2.5.12566
It's free, it's getting pretty good, it can handle multiple repositories.
The setup is easy, you only need to know that (sometines) you have to select it in Visual Studio, enough tutorials online so good

luck.
You can work perfectly without AnkhSvn if you know svn well, it's just handy.

The finishing touch (You can do without it, but I think it's really handy)

Installed Resharper V9Update1
It's NOT free, you can get a 30 day trial or be creative.
You can work perfectly without resharper, but I'm addicted to it.

=====================================
Finished installing software(for now)
=====================================

All software needed to compile/debug and getting the code is now installed.
Let's get the code...

Get yourself a folder somewhere convenient(it's source code!) and call it HomeGenie or whatever convention you're already using.
Now right click on the folder and select SVN Checkout...
Insert the URL of the repository: svn://svn.code.sf.net/p/homegenie/code/trunk
Click OK and it should get the latest revision of HomeGenie.
In my case that was revision 460

Before starting the solution please make 2 folders bin and debug
You create this path: HomeGenie\HomeGenie\bin\debug
Copy really EVERYTHING from HomeGenie\BaseFiles\Windows to HomeGenie\HomeGenie\bin\debug

Now we have the code, find the solution file HomeGenie_VS10.sln
Let's first take windows, later on linux will be discussed, I don't do mac.

If you've gotten so far, let's build.
Well that became very simple since revision 460.
Just open a context menu on the solution or choose it from the menu or hit F6 like I do.
The first time you run there's a possibility that you encounter an unhandled exception.
Stop execution with SHIFT-F5 and run again, this workaround works for me, it only happens once.

If you want to see what's going on, my advise would be to open the output window.
It's under menu->DEBUG->Windows

*****************
Finished building
*****************

I could now start running and debugging, but before you do that, remember I had a clean install.
If you've installed the windows version of HomeGenie you must stop the HomeGenie service before doing that.
If you don't you'll have 2 HomeGenie services at the same time listening on different ports.
If the first HG is on port 80, the second will take 8080 and the third 8081 and so on.

There was an issue when running HG the first time.
The system could not find System.Data.SQLite.dll or one of its dependencies.
The workaround is to start it again for now, this only happens once and you really need a fresh checkout to let it happen.

The HomeGenie project's name should have a bold font, that means it's the startup project.
If it's not the active project, make it the active by using the context menu.

Now hit Run in your toolbar.
A console window should open and you see HomeGenie logging.
Open a browser and go to http://localhost/

Now you can debug if you know how to use Visual Studio.

If you have a clean win7 install like me, there is only IE8 and HG doesn't look pretty.
Get yourself an up to date browser, IE, Firefox, Chrome, they all work.

This is the first part of the tutorial, I'll wait for reactions before I spend more time on it.

Deploying to RPi with my own HG modified code or latest HG revision and the same for RaspberrySharp.IO on Raspberry Pi is my next

goal.
It could be the next chapter...





« Last Edit: January 22, 2015, 08:37:59 PM by Wibo »

January 19, 2015, 11:43:17 PM
Reply #10

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Looks helpful.  When I installed VS2010 Express I also had to install a Mono compiler.  Does VS2013 Community include a Mono compiler by default, or did you install one that wasn't listed?

January 20, 2015, 03:18:22 PM
Reply #11

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Wibo,

I tried to fix problems in VS solution file.
Now to compile it just needs one step:

- right click on the main solution folder and select Build All.

When debugging no worries about http port 80 already taken since HG automatically locates the first free port >= 8080 if the default one is already in use.
To find out what port HG is running on, just look at the output in the console window. The first line will tell on which port hg is running.

Quote
I think that creating linux packages and windows installers is something that must be done centralized(read Gene).

I read, but dunno how to do this.

If you're curious about what inside the Linux Packager project, I'll tell you, it's just a bash script that call dpkg to build the debian package.

Cheers,
g.

January 20, 2015, 06:54:52 PM
Reply #12

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi all,

@bkenobi
I used VS2010 pro first time and had no need for a mono compiler, afaik this is only needed on platforms where VS doesn't run.
When modifying the RaspberrySharp.IO library I compiled it on windows with VS2010.
Copied my test program on the RPi and excecuted it with "sudo mono MyTest.exe"
Mono on RPi did everything for me as VS did everything for me on windows.

@Gene
Got me a fresh checkout on r460.

Can confirm (Re)build all works without prebuilding anything on the win solution.
The SQLite issue is back, but that was your intention, I checked you're changes.
I'm going to correct the draft tutorial by modifying the previous post if that's ok.
I'll throw in the port stuff that I didn't know off and explain how to fix the SQLite issue.
Just sit back, I'll do the work.

Thanks for the info about the bash script and dpkg, now I know what to search for.
This is not a high priority anymore, just wanted to know how far I could get.

Regards,
Wibo.

January 20, 2015, 08:56:51 PM
Reply #13

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi Gene,

there is an easy workaround for the SQLite issue, but the cause is unclear to me.
The problem is that I can't reproduce it any more.

I took a fresh checkout r460, build and run and exception.
Second and third run everything was fine.

I took a new fresh checkout r460, build and run and exception.
Second and third run everything was fine.

I took some other fresh checkouts(3) and the problem was gone.

Since I have no copy of the exception I have to do this from memory.
It was a SystemFileIOException telling that System.Data.SQLite.dll or one of its dependencies could not be found.
The exception was thrown in SQLite? where it dynamically loads all kinds of stuff.

It smells like a timing bug, but I'm not sure.
It's not a big deal to me, but I wanted you to know.
If it happens again I'll make sure I got you decent info.
Nothing so frustrating as a bug that disappears while you're hunting it.

Regards,
Wibo.

January 20, 2015, 09:06:27 PM
Reply #14

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Wibo,

SQLite dll files are copied over the build directory from the Common/Windows solution files, so this project must be built each time your clean the output folder.
In HomeGenie project the dll MUST be not flagged as "copy to output folder".
This is because Linux-Mac and Windows solutions use different version of the SQLite library that is indeed copied by the platform specific project (Common/Linux or Common/Windows).

Cheers,
g.