The swagger file is a description of what the service looks like. It's not executable code and it's not source code written in a programming language that you could just compile.
You will need a code generator that generates your source code in the language of your choice from this file. (When I say "need", I don't mean you must do it... you can type it all out yourself. But that would be time consuming and ultimately pointless because a generator will do a much better job than a human on average.)
As generator you can for example use:
For example with the swagger codegen (first link, follow the download and installation instructions), this line will generate a folder with C# code that you will need to include in your project:
java -jar ./swagger-codegen-cli-2.4.5.jar generate -i your.yaml -l csharp -o output_folder
You will need to replace your.yaml
with your filename and output_folder
with the folder you want the generated files to end up in.