[Solved] C# async and await keywords not working as expected with property getter [duplicate]

When the compiler encounters await keyword it will automatically schedule a task in task scheduler. The operation waits (in a non-blocking manner) for the task to complete before continue to do the rest of the code block. To make your code run in parallel you need to modify it into public async Task GetDistance() { … Read more

[Solved] How to pass array to method [closed]

make it into an ‘out’ parameter and all should be well: private void x() { string sTestFile = “this is a test”; string[] TestFileWords; FixConcatString(sTestFile, out TestFileWords); } private void FixConcatString(string splayfile, **out** string[] sWordArray) { char[] charSeparators = new char[] { ‘-‘ }; splayfile = splayfile.ToLower(); splayfile = splayfile.Replace(@”\”, ” “); sWordArray = splayfile.Split(charSeparators, … Read more

[Solved] How to read and update Excel from WPF screen [closed]

I find these link useful. Try out once http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/read-write-and-update-an-excel-file-in-wpf/ http://www.dotnetcodesg.com/Article/UploadFile/2/4331/WPF%20Read%20Write%20and%20Update%20in%20an%20EXCEL%20File.aspx solved How to read and update Excel from WPF screen [closed]

[Solved] A type or namespace name ‘register’ could not be found

This will not work, as Show is an instance method, not a static mathod: register form = new register(); register.Show(); You probably meant: register form = new register(); form.Show(); Note: Your naming is non standard – types in .NET are normally in PascalCase – to be consistent, your should name the class Register. Additionally, using … Read more

[Solved] methods that give error [closed]

I missed that this method start with get_ Here is right answer. Just find “this HttpConfiguration” on entire solution. You can find extension method named start with “get_” If this solution not work.. find “this IDisposable” on entire solution. because HttpConfiguration class is implement of IDisposable 2 solved methods that give error [closed]

[Solved] Can you downgrade from VS 2019 to VS 2017

You don’t have to downgrade. Visual Studio 2019 and 2017 run side by side. Installing Visual Studio 2019 installs a new application in a different path. It doesn’t upgrade VS 2017, so there’s no reason to downgrade. I’m using VS 2017 and VS 2019 on the same machine for about 6 months now without issues. … Read more

[Solved] Does this code block the file? [closed]

Depending on what you want you could add a fourth parameter to the File.Open method. To open the file with read only access and allow subsequent opening of the file for reading: private Stream GetFileStream(String path) { return !File.Exists(path) ? null : File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read); } This allows read and write: private Stream GetFileStream(String … Read more

[Solved] Escaping a dot in c# [closed]

That’s not how enums work. You need something like this: private enum UserAgents { MSIE70, MSIE60, MSIE50 } But then you have to worry about getting the string value out of it, the flags don’t match the string representation either. You could decorate them with DescriptionAttributes but then you still have to do all the … Read more