Development Builds
ClosedXML uses CI for the develop branch and every PR. The CI compiles the branch, runs tests and generates nuget packages for the branch.
In order to test a nuget dev builds, we have to overcome few obstacles: The main problem with NuGet packages is that they are cached, even development ones (see https://github.com/NuGet/Home/issues/6579).
NuGet downloads First, we must create a local nuget source. NuGet uses a list of sources to restore a package.
If you are on Linux or just like CLI, add a new source
PS C:\> dotnet nuget add source C:\Temp\nuget-packages\ --name ClosedXml.Local
Package source with Name: ClosedXml.Local added successfully.
You can look through your sources to check if they are in correct order or if they are enabeld or disabled.
PS C:\> dotnet nuget list source
Registered Sources:
- nuget.org [Enabled]
https://api.nuget.org/v3/index.json- Microsoft Visual Studio Offline Packages [Disabled]
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\- ClosedXml.Local [Enabled]
C:\Temp\nuget-packages\
Check that the the local source is enabled
Fundamental principal of NuGet is that package should be same for a specific version in each source, therefore the order of sources is not significant.
In the Visual Studio, got to Visual Studio Tools -> Options -> NuGet Package Manager -> Package Sources
Go to the AppVeyor CI to the Artifacts tab and download the nuget package to the local NuGet source. You can download from the PR or the unstable develop branch at https://ci.appveyor.com/project/ClosedXML/ClosedXML/branch/develop/artifacts.
NuGet caches all retrieved files (either from local sources or from some web) in the local cache. When a project asks to restore a package, nuget first looks into the cache to check if the requested version has already been retrieved. This behavior is good for normal usage, but can be problematic for development builds that have a same version (e.g. 0.97.1-preview), but are built from different commits.
Go to the local cache directory (should be in the user home directory under .nuget/packages), in the closedxml directory remove the version you want to restore from the local source.
Add a dependency on your preview verion to the PackageReference of your csproj file
Either modify the csproj file
<!-- A reference to a preview package 0.97.1-preview downloaded from the AppVeryor CI -->
<PackageReference Include="ClosedXML" Version="0.97.1-preview" />
or use dotnet tool
PS C:\Temp\DemoProj> dotnet add package ClosedXML -v 0.97.1-preview
Determining projects to restore...
And done, just build and everything should work to test out the dev build:
- nuget will check the cache if a package with specificed version is already there
- nothing will be found in the cache, because we deleted it.
- nuget will try to check sources for the dev package.
- nuget won't find anything in the offical relase source (e.g. nuget.org)
- nuget will find the package in the required version in the local source for CLosedXML
- nuget will copy the dev package to the cache and to the project (along with dependencies and other stuff).
You can check that the ClosedXML is the correct one by probing the CloseXML.dll in the bin folder. Either optn the dll in a dotPeek tool or by looking at the properties of the dll (the upper is a build number from AppVeyor):
- How do I deliver an Excel file in ASP.NET?
- Does it support Excel 2003 and prior formats (.xls)?
- How can I insert an image?
- Text with numbers are getting converted to numbers, what's up with that?
- How do I get the result of a formula?
- Data Types
- Creating Multiple Worksheets
- Organizing Sheets
- Loading and Modifying Files
- Using Lambda Expressions
- Cell Values
- Workbook Properties
- Using Formulas
- Evaluating Formulas
- Creating Rows And Columns Outlines
- Hide Unhide Rows And Columns
- Freeze Panes
- Copying Worksheets
- Using Hyperlinks
- Data Validation
- Hide Worksheets
- Sheet Protection
- Tab Colors
- Conditional Formatting
- Pivot Table example
- Sparklines
- Copying IEnumerable Collections
- Inserting Data
- Inserting Tables
- Adding DataTable as Worksheet
- Adding DataSet
- Styles - Alignment
- Styles - Border
- Styles - Fill
- Styles - Font
- Styles - NumberFormat
- NumberFormatId Lookup Table
- Style Worksheet
- Style Rows and Columns
- Using Default Styles
- Using Colors
- ClosedXML Predefined Colors
- Excel Indexed Colors
- Using Rich Text
- Using Phonetics
- Defining Ranges
- Merging Cells
- Clearing Ranges
- Deleting Ranges
- Multiple Ranges
- Shifting Ranges
- Transpose Ranges
- Named Ranges
- Accessing Named Ranges
- Copying Ranges
- Using Tables
- Sorting Data
- Selecting Cells and Ranges
- Row Height and Styles
- Selecting Rows
- Inserting Rows
- Inserting and Deleting Rows
- Adjust Row Height and Column Width to Contents
- Row Cells
- Column Width and Styles
- Selecting Columns
- Inserting Columns
- Inserting and Deleting Columns
- Adjust Row Height and Column Width to Contents
- Column Cells
- Pages Tab
- Paper Size Lookup Table
- Margins Tab
- Headers and Footers Tab
- Sheet Tab
- Print Areas and Page Breaks