A colleague of mine supplied a .dll file with certain functions inside. I am trying to incorperate this .dll into an app I'm making.
For now, it looks like this (code shortened for improved readiblity) :
public static void ExecuteProject(string project)
{
string projectPath = @"" + project + ".txt";
LConvertRows(File.ReadAllText(projectPath), Model, Statements);
}
For now it is dependend on a file inside of the debug folder. I am trying to replace projectpath with text inside of a textbox. Like so :
View T = new View();
string projectPath = T.txt_CodeDetail.Text;
EDIT : This is the button that summons the method, and supplies the project string
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
ExecuteProject();
}
Since the depend file is a .txt file I didnt think this would be a problem. This however, shows the following error :
System.IO.PathTooLongException: 'The specified path, file name, or both are too long.
The fully qualified file name must be less than 260 characters,
and the directory name must be less than 248 characters.
I've read this doesn't happen at .NET Framework 4.6.2, I am however stuck with 4.5.2 due to external conditions.
I've also read about a library Delimon.Win32.IO.dll that fixes this issue, but can not find a link to it anywhere.