swati
swati

Reputation: 31

The invocation of the constructor that matches the specified binding constraints threw an exception

When I am trying to create a new directory in my WPF application i am getting the following error.

" 'The invocation of the constructor on type 'NetworkApplication.Login' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'."

this is my line of code

DirectoryInfo di = Directory.CreateDirectory(@"C:\\Windows\\Newfolder1");

Upvotes: 1

Views: 4186

Answers (1)

David Brenchley
David Brenchley

Reputation: 86

Besides the security issues, you're trying to escape a string that has the @ in front of it. Either remove the @ or un-escape the slashes.

Upvotes: 3

Related Questions