1973 2
How do i format or beautify code in Visual Studio code?

I have just started using Visual Studio code, but i am not able to format code in it, I have tried ctrl k+ Ctrl d but it doesn't work, any helpful link for it?

...
Type
Question
visual-studio-code code-formatting code-beautify php c#
1907 2
Error : Keyword not supported: 'metadata'

I was trying to use Hangfire.IO in my MVC ASP.NET boilerplate application and pasted this code in Startup.cs as explained here in tutorial

...
Type
Question
C# ASP.NET Keyword-not-supported
1884 2
Multiple actions were found that match the request: in web api C# ?

HI, I am trying to work with the Web API in C#, and when calling it using jquery I am getting the error "Multiple actions were found that match the request: in web API C#", so how to resolve this issue, here is my current code

...
Type
Question
C# MVC Web-api multiple actions were found error asp.net
1865 2
"Invalid URI: The format of the URI could not be determined" Error in C#

I am trying to run the below code in my asp.net MVC web-application, to get the URL of first image(<img>) in the HTML string, using the code below

       public static List<Uri> FetchLinksFromSource(string htmlSource)
        {
            List<Uri> links = new List<Uri>();
            string regexImgSrc = @"<img[^>]*?src\s*=\s*[""']?([^'"" >]+?)[ '""][^>]*?>";
            MatchCollection matchesImgSrc = Regex.Matches(htmlSource, regexImgSrc, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            foreach (Match m in matchesImgSrc)
            {
                string href = m.Groups[1].Value;
                links.Add(new Uri(href)); //getting error here
            }
            return links;
        }

but I am getting this error "Invalid URI: The format of the URI could not be determined" when I run this code, here is the image of the error

...

Type
Question
C# asp-net-mvc invalid-uri asp.net
1863 0
Exception handling in C# (With try-catch-finally block details)
In this article, I will explain you in detail about the concept of Exception handling in C# and how we can use try-catch block to handle errors with example.
Type
Article
C# exception handling c# exception c# try catch

1851 2
Git push error "git did not exit cleanly (exit code 128)" , how to solve?

When I am trying to push my new commit using Tortoise-Git on server, I am getting this error "git did not exit cleanly (exit code 128)", here is the image of the issue

...

Type
Question
Git push error git did not exit cleanly
1757 2
How to convert JSON String into C# class object

I am trying to convert JSON object into C# class object, Using a really simple test case:

...
Type
Question
JSON C# serialization deserialization
1625 2
DbArithmeticExpression arguments must have a numeric common type

When I am trying to run this command using Entity framework in controller of my project

...
Type
Question
C# Linq Entity Framework
1611 1
how to implement switch case in Razor (.cshtml)?

I need to implement switch case in Razor C# page as if-else would not be a good idea, because it will create too many conditions, so i thought to create Switch case instead, here is my current code, but it throwing syntax error

...
Type
Question
razor C# razor syntax select case switch in mvc view switch case in razor
1475 2
Convert string of "dd/MM/yyyy" format into Datetime using C#?

I am using the code below to convert my string which is in the format "dd/MM/yyyy" into datetime

...
Type
Question
C# asp.net Datetime-conversion string

Page 2 of 12