forked from jonwagner/Insight.Database
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Building.txt
96 lines (86 loc) · 6.04 KB
/
Building.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Notes for Building Insight
===============================================
Getting the basics up and running, e.g. for a pull request
-------------------------------------------------------------
* Install the Visual Studio extension EditorConfig.
This will read the .editorconfig file in the solution dir so when you edit files you don't mess with the tab scheme etc
and make it hard to diff and merge your code. If you don't do this it's hard to ensure that you get 'credit'
for the lines of code you are contributing.
* Everything but Insight.SQLite.Tests should build properly when you build the solution (SQLite is addressed below)
Set up the test database
-------------------------------------------------------------
* By default Insight.Tests' config file is looking for local installed SQL server (default instance) with a database named InsightDbTests
* To use a LocalDb option instead (or skip the the next '*'):
- Install LocalDb, e.g. from here https://msdn.microsoft.com/en-us/library/hh510202.aspx
- >cd C:\Program Files\Microsoft SQL Server\130\Tools\Binn
- >SqlLocalDb create InsightDb
- >sqllocaldb share insightdb insightshare # We are only sharing so the pipe won't change on each start
- There are two option to get the tests connected your sql server when using local db:
1) Create an alias for your instance:
a) SqlLocalDb start followed by SqlLocalDb info. Copy the pipe, excluding 'np:'
b) Open 'SQL Server Configuration Manaager'
c) Goto SQL Native Client Configuration/Alias, select 'New Alias'
d) Fill in the fields in exactly this order because otherwise the UI will 'fix' things for you!
- Protocool = Named Pipes
- Alias Name = . # (just a dot)
- Server = . # (just a dot)
- Pipe = <pipe name> # Eg: \\.\pipe\LOCALDB#SH66D071\tsql\query
e) repeat this for the 32 bit version of the QL Native Client Configuration/Alias
(Note that you could also do this step with cliconfg.exe, just do it in both: in /System32 & /SysWOW64)
2) Or, instead, enable the LocalDb connection string that is commented out in app.config. (note that '(localdb)' is literal).
Repeat for Tests.Compatiblity3x, Tests.Glimpse, Tests.Json, Tests.MiniProfiler (easier, but way more annoying over time)
* Confirm all tests pass for Insight.Tests
Install special Database drivers
-------------------------------------------------------------
If you are doing a small edit, you can skip this section and just unload these 3 projects and their test projects.
* SQLite.
- Resolve the error in Insight.SQLite.Tests
- The SQLite files will be downloaded by Nuget to <Solution>\packages on first compile.
- SQLLite on Windows requires the SQLLite runtime to be in the project directory.
- Go to \packages\System.Data.SQLite.Core.x.x.x.x\content\net451
- Copy the \x86 and \x64 directories to the root of Insight.Tests.SQLite
* Db2:
- Direct Link: https://1drv.ms/u/s!Aisu0-5GSeCIsjJiLV_SKSgIG_qe
- OR: Go to http://www-01.ibm.com/support/docview.wss?uid=swg24041038 and get the 'IBM Data Server Client'
- (Wags' Note: I didn't have to turn off UAC or copy the files below.)
- IF YOU ARE RUNNING UAC, YOU MUST TURN IT OFF. There is no UAC prompt, you just get error 10...You must disable UAC
- Run \CLIENT\db2\Windows\IBM Data Server Client.msi
- Choose custom install, only choose 'Base client support' and 'IBM Data Server Provider for .NET'
- Use the default path
- Uncheck 'enable OS Security' OR run cmd 'net localgroup db2users "YourUserName" /Add' (I just unchecked the check box)
- Turn UAC back on
- You must copy db2app64.dll and db2app.dll from %Program Files%\IBM\SQLLIB\BIN to ..\Insight.Tests.DB2\bin\db2app64.dll
(Thx http://stackoverflow.com/questions/7484349/sql1159-initialization-error-with-db2-net-data-provider-reason-code-2)
* Sybase ASE:
- Direct Link: https://1drv.ms/u/s!Aisu0-5GSeCIsjay_paw3f_1GEcW
- OR: Download the "Get a Free Developer Edition" from http://scn.sap.com/community/developer-center/oltp-db
- Choose Custom Install when given the option.
- Only install the .Net ADO package from the custom install. (make sure the faint half ticks are cleared)
- Install it in the default location
* Oracle (Not OracleManaged):
- Direct Link: https://1drv.ms/u/s!Aisu0-5GSeCIsjT6GwdJNyuwLYCb
- OR: Go to http://www.oracle.com/technetwork/topics/dotnet/index-085163.html
- Click 'Download ODP.NET via ODAC'
- Choose the ODAC download, not ODP_Managed. I downloaded the msi, but note there is also an XCopy version which may be better.
- Options are:
- install location: C:\Oracle
- Install: 'Oracle Data Provider for .NET' (again avoid the managed driver for this project)
- You should now see C:\Oracle\odp.net\bin\4\Oracle.DataAccess.dll
Doing a full build
-------------------------------------------------------------
Do this to ensure your code runs on all platforms (.Net 3.5, 4.0, 4.5, Mono, etc.)
* This does require install the database drivers listed above
* A full build also requires Psake
- You can get it from http://nuget.org/packages/psake/
- Or, with PowerShell 5 run this from the PowerShell cmd prompt:
Install-Module "psake"
Note: add '-Scope CurrentUser' or run this from an elevated Powershell prompt
* To build run 'build.bat'
Use Vagrant to get a virtual server with Db2, Sybase & Oracle so those tests work
---------------------------------------------------------------------------------------
* Install Vagrant - https://www.vagrantup.com/
* Install Virtual Box or other VM Provider (Note that Vagrant wants money to link up with VMware)
* From the root of Insight, run 'Vagrant up', this will provision your VM (it takes ~15 mins the first time)
* To shut down: 'Vagrant Suspend', Restart: 'Vagrant Reload'
* One issue I had to fix was that the PostgreSQL version changed and that required some small vagrant updates.
See the commit 1bfa684 for details when this happens again.