XElement contactsFromFile = XElement.Load( Server.MapPath( "~/App_Data/test.xml" ) );
There is a system property called "HostingEnvironment.ApplicationPhysicalPath" which gives you the root directory where your app is deployed. I think you should be able to do something like this:
HostingEnvironment.ApplicationPhysicalPath + "/App_Data/text.xml"
- LINQ Source Code Available
- .NET 4 Code Contracts: "requires unproven: source != null"
- C# .Net 3.5 Code to replace a file extension using LINQ
- creating Linq to sqlite dbml from DbLinq source code
- Cannot build the Test project for LINQ IQueryable Toolkit (IQToolkit) - Code 9009
- Why are stored procedures, functions, and views put into a .dbml file instead of the code file?
- Do I need to add a DB file to the project to us LINQ to SQL?
- source code for LINQ 101 samples
- I need to save the XML file using linq with xml code in C#
- Will Linq query code in C# UWP project work slower or faster depending on order of its' parts?
- c# code to read xml file values
- Construct a list of wpf Hyperlink elements from an XML source file using Linq
- List or Array of String Contain specific word in Html Source Code
- Insert a file path string into SQL database via C# code
- c# Linq or code to extract groups from a single list of source data
- Why can I not use the same poco in code first in EF4.1 to project my data?
- fill object data source with class in another project
- How to load xml code block into existing xml file at a specific node using linq
- Convert string to int in one line of code using LINQ
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- Value cannot be null. Parameter name: source
- Linq code to select one item
- C# - code to order by a property using the property name as a string
- How do I find the text within a div in the source of a web page using C#
- Roslyn failed to compile code
- Entity-framework code is slow when using Include() many times
- What is difference between .edmx and .dbml file in linq?
- The data source does not support server-side data paging
- Reading a file line by line in C#
- How are people unit testing code that uses Linq to SQL
- How to get list of an entity with generic search
- Set or update data in LINQ
- Add watch window shows value but the value is not assigned to variable
- LINQ to XML select subquery attributes into a string list
- Using linq to set multiple elements
- Parsing a text file to CSV using LINQ
- How to get multiple XML elements that are descendants of another element
- How to use a LINQ : If there are several min and max values, just remove only one min and max value in List
- Find the exact week count based on date range
- Remove "duplicate" results with Linq on LEFT OUTER joins
- LINQ TO Entitites : Combining Two Non Related Tables in Query
- Text box AutoCompleteSource (winForms) and LINQ query
- How can I interact with accented letters inside list<dynamic>?
- How does linq concat work under the hood?
- Building a dynamic anonymous type Select statement using Linq
- LINQ - Split results in months
- linq-to-query and contains for an IEnumerable<string>?
- JSON Deserialization in C# comparison
- Simple linq question: How to filter a source afterwards?
- This method is not supported against a materialized query result