You already moved your development into considerable abuse. No, you cannot access the file using
Environment.Current
directory. You don't really control this directory, your user does. The user can start an application from absolutely any directory, and then it will be the current directory at the moment of the application start. Your file will be very well lost. Just forget it.
But generally, you biggest problem is poor understanding the difference between runtime and design time. During runtime, there is
Environment.Current
directory but there is no such concept as "project"; there are assemblies. During design/build time, there is no a current directory, and there are projects.
Instead of doing nasty abuse, you can do million of other valid things. You could store the the file in a resource of one assembly. Another assembly could reference another one, which could provide access to either XML string, or stream, of just XML data via some API. This way, you could share this data in both assemblies. If the XML can be readonly, you can put both assemblies in the same executable directory (not current directory!) and share it there (please see my past answer:
How to find my programs directory[
^]). Better yet, you could abstract out the data from XML file. You could use Data Contract to share some
object graph read from XML, which could be done by only one of the assemblies. Please see:
https://msdn.microsoft.com/en-us/library/ms733127%28v=vs.110%29.aspx[
^]. This way, XML would be just the implementation detail, and you would not work with XML directly. And so on.
Just to give you some conceptual understanding: please see:
https://en.wikipedia.org/wiki/Single_Source_of_Truth[
^],
http://en.wikipedia.org/wiki/Don%27t_repeat_yourself[
^].
—SA