The ReSharper unit test runner doesn’t like test methods which are declared as “async void”.
Unfortunately you won’t get any compiler or intellisense warning to tell you. When trying to run the test in ResSharper unit test runner it will first get a blue question-mark icon and when you run it individually it will get the test result Inconclusive.
public async void This_Test_Will_Cause_Inconclusive_Message()
public async Task This_Test_Will_Run_Ok()
If I want to display a PDF file in the browser instead of downloading a copy, I can tell the browser via an additional Content-Disposition response header.
This code example assumes that the file content is available as byte-array, reading the content from a database, for example.
// Get action method that tries to show a PDF file in the browser (inline)
public ActionResult ShowPdfInBrowser()
byte pdfContent = CodeThatRetrievesMyFilesContent();
if (pdfContent == null)
var contentDispositionHeader = new System.Net.Mime.ContentDisposition
Inline = true,
FileName = "someFilename.pdf"
return File(pdfContent, System.Net.Mime.MediaTypeNames.Application.Pdf);
Please keep in mind that ultimately we don’t have control over the browser. We can politely request to show the PDF inline, but this can be overridden by a user configuration, for example.