In my .NET assembly I need to access an XML file which is in ‘Import’ folder off my class assembly project.
How do I do this? Almost like ASP.NET Server.MapPath() but for an assembly. I don’t want the reflection method of getting the currently executing assembly as this points to the GAC folder. I want the folder of the current project.
I also need this to work when being deployed. Basically it is importing an XML file and inserting the seed data using EF Code First database initializer. This is bootstrapped in the Global.asax.cs. I need it to work both in development and on live target.
Assembly.GetExecutingAssembly().GetManifestResourceStream(path)