Click here to Skip to main content
16,019,480 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to find out dynamically the path of class file where i am coding: Means if i am working in calss file : abc.cs,then i want to find the path of abc.cs by code in abc.cs in c#.
Posted

1 solution

You can't: once the project is compiled, there is no link to the source code (except in debug builds, where extra info is added so the debugger can link the two).

You can find the folder the current assembly is executing from though, if that helps?
C#
string folder = Assembly.GetExecutingAssembly().Location;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900