Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: Cannot modify header information - headers already sent by (output started at /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/.sites/946/site2164767/web/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1723 Warning: Cannot modify header information - headers already sent by (output started at /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/.sites/946/site2164767/web/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1723 Warning: Cannot modify header information - headers already sent by (output started at /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/.sites/946/site2164767/web/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1723 Warning: Cannot modify header information - headers already sent by (output started at /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/.sites/946/site2164767/web/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1723 Warning: Cannot modify header information - headers already sent by (output started at /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/.sites/946/site2164767/web/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1723 Warning: Cannot modify header information - headers already sent by (output started at /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/.sites/946/site2164767/web/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1723 Warning: Cannot modify header information - headers already sent by (output started at /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/.sites/946/site2164767/web/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1723 Warning: Cannot modify header information - headers already sent by (output started at /home/.sites/946/site2164767/web/blog/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/.sites/946/site2164767/web/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1723 {"id":88,"date":"2015-09-29T19:56:39","date_gmt":"2015-09-29T17:56:39","guid":{"rendered":"http:\/\/blog.zoolway.com\/?p=88"},"modified":"2015-09-29T19:56:39","modified_gmt":"2015-09-29T17:56:39","slug":"go-open-source-with-your-net-project","status":"publish","type":"post","link":"http:\/\/blog.zoolway.com\/go-open-source-with-your-net-project","title":{"rendered":"Go open-source with your .NET project"},"content":{"rendered":"

Have you ever wondered how hard it could be to share your project with the world wide web?<\/p>\n

With Visual Studio 2015, GitHub and NuGet you can easily publish the source code and binary library of your project to the open-source community! Of course you can do similar with other IDEs and platforms but those resemble to most popular ones.<\/p>\n

Let us see how easily we can do this.<\/p>\n

<\/p>\n

To try this out I am sharing a .NET geometry PCL library with the world, Zw.Geometry<\/strong>. It most not necessarly be very successful, wide-spread or popular but I just wanted to share it as I cannot find something as simple as it and still have some features to be added. So let us give back and provide others with the possiblity to use an existing library to rotate points in a 2D coordinate system without reading all those trigonometry formulars.<\/p>\n

First we will require a GitHub account<\/a> if you do not have already one. I will use GitHub to publish the source code and be able to share it with others and even be able to accept their inputs to my projects (push requests). Next, for those who will purely consume my library, I will require a NuGet account<\/a> which is a wide-spread package manager for .NET tools and libraries. It is even not limited to Visual Studio as its command line tools are available of others IDEs and Mono too. With the account we can publish packages for others to use.<\/p>\n

\"os-github1\"<\/a>At this point I already started the small\u00a0solution which consists of the main project file and a test project with the unit tests. With the Microsoft Git Provider the\u00a0solution already has a local versioning repository.
\nSo we create a new GitHub remote repository with which we will be able to sync. We should not include a README at this point, we can add it later.<\/p>\n

After the creation GitHub shows us the URL to the repository, like\u00a0https:\/\/github.com\/ZoolWay\/Geometry<\/a><\/p>\n

\"os-teamexplorer1\"<\/a>In Visual Studio we can now select the Team Explorer, Home, Sync and setup the remote repository in the yellow highlighted Textbox (“Publish to Remote Repository”).
\nAfter that we can Sync or Push our commits to the remote repository.<\/p>\n

Now you can check out your repository in the webbrowser in GitHub and should be able to see all your source code. You can now add a README and license file those will be downloaded\u00a0to your local repository the next time you perform a sync. Note: That will not be visible in Visual Studio by default because they are not added to the VS solution file but you can see them in the file system and if you would like manually add them to your repository.<\/p>\n

At this step you are\u00a0ready to go. Find some friends to work on your project. They can checkout (subversion speaking) or more clone (git like) the repository.<\/p>\n


\n

\"os-nuget1\"<\/a>When you have a nice library (or other project) most people just would like to use it. They are not interested in cloning the repository and have all the code. A binary and reference will be fine. This is what NuGet provides to the .NET community for quite some time now. The NuGet client is available as Visual Studio integration and command line utility but only the later will help you to pack your binary for the NuGet gallery.<\/p>\n

I mostly followed the instructions from the\u00a0NuGet docs<\/a>\u00a0and just encountered\u00a0minor pitfalls here. Thanks to the extension Open Command Line<\/strong> I can just rightclick my project file and open the VS command prompt in the folder. But by default there is no NuGet command line utility so I downloaded it and put it into the folder\u00a0C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tool<\/em>s. It is then available in the path when using VS command prompts.<\/p>\n

To create a new .nuspec file for your project you can just<\/p>\n

nuget spec\r\n<\/pre>\n

After that I included the Zw.Geometry.nuspec into my solution to easily edit it from Visual Studio. Most things can remain unchanged as placeholders are used (which inject information from AssemblyInfo.cs when packing). I added URLs to my project and license and added some tags.<\/p>\n

When everything is ready, the unit tests run fine and you do your first release you can run<\/p>\n

nuget pack MyProject.csproj\u00a0-Prop Configuration=Release -Build<\/pre>\n

Read the docs to get more information about other flags and dependencies to other projects.<\/p>\n

The resulting MyProject.1.0.0.0.nupkg can be uploaded using the NuGet webinterface – or you can automate it with an API key and some scripts.<\/p>\n


\n

Those are the main steps. Of course there is many things left to really have a successful open source project but I felt a short starter like this would be helpful.<\/p>\n

You can find my small sample library online:<\/p>\n