anthonychu / azure-functions-static-file-server

MIT License
54 stars 35 forks source link

MimeTypes could not be found error #3

Open aarsan opened 6 years ago

aarsan commented 6 years ago

Thanks for putting this together. However, when I run this, I get the following errors in my logs:

2017-11-03T04:15:46.887 run.csx(5,7): error CS0246: The type or namespace name 'MimeTypes' could not be found (are you missing a using directive or an assembly reference?) 2017-11-03T04:15:46.887 run.csx(81,12): error CS0103: The name 'MimeTypeMap' does not exist in the current context

Thanks! Ahmet

DamianKomorowski commented 6 years ago

Probably not installed dependencies. Make sure you have the file "project.json" in the function folder { "frameworks": { "net46":{ "dependencies": { "MediaTypeMap": "2.1.0" } } } }

If you make an deploy with GitHub it should work the first time :) image

A9G-Data-Droid commented 1 year ago

If you are using https://github.com/khellang/MimeTypes you will find that this happens because that library uses auto-generated code. The type doesn't exist until it has been generated. You get this on a clean, before NuGet restore.