user746461
user746461

Reputation:

Share a file for C# project at home and at office

I have formed a number of source code files as my library. For example, I wrote LinqExtension.cs providing Median() function.

Now I'm working on a project which needs LinqExtension.cs. As usually, I link the file to the project. As introduced here. The reason that I link files rather than copying them is to keep the files at a single location. If I modify a file, all dependent projects get affected.

I also add the project to Subversion and upload to and download from Google Code. The linked file is not under version control.

I work on the project at home as well as at office. I hate copying the linked file to my office, which makes the file not single.

I figure out a solution that add <Compile Include="http://www.example.com/LinqExtension.cs"/> to csproj file so that the file only exists on the Internet. Once I upload a new verison of the file, all dependent projects get affected. Unfortunately the solution doesn't work.

Any other suggesions or better practice?

Upvotes: 3

Views: 138

Answers (2)

Totero
Totero

Reputation: 2574

I like to keep a library folder of binaries in my Dropbox. That way Common libraries that I use can be accessed from my home and work project workspaces and the service keeps the version up to date.

Upvotes: 0

Richard
Richard

Reputation: 30628

A better way would be to share your core library at the binary level, rather than at source code. You could set up a private Nuget repository to make this easier.

If it is absolutely necessary to share files, you can use pre-build actions in your project to copy the file from a common location, or even download them from google code. It's not clean, but if you don't want to use source control for it then I don't think you will find a clean way.

Upvotes: 2

Related Questions