Question: I have one WCF service deployed in multiple websites hosted in IIS7 and sometimes (development environemnt) in VS2010. 

Often multiple instances are connected to the same database and usually its not a problem as its read-only access, but sometimes (like in logging) I need to uniquely identify instance of the service accessing DB.

Currently I do it by putting special attribute in web.config which I'll later use as a part of primary key, but I do feel its not ideal solution.

I thought about site-name in case its hosted in IIS and machine name + port if its hosted from VS2010.

And here comes the question: How to access info about where the WCF service is deployed and how to do it programmatically from inside of deployed service in c#? Is it at all possible?

Thank you for your suggestions.
Michal

Answer: 
error C2857: '#include' statement specified with the /YcStdAfx.h command-line option was not found in the source

This means the compiler (VisualStudio 2010) is forcing the inclusion of StdAfx.h but in the source you are not including it.

Try adding:

```
#include <StdAfx.h>

```

at the top of your source file.
SanSS already explained the error message. Let me shortly explain the warnings. The first warning about scanf can be ignored at this point. The problem with scanf is that it is unsafe, if you try to read in a string into a pre-allocated C-string (e.g. a char array or char pointer). You are reading in a float, which always has a fixed size (usually four bytes). So no overflow can happen here.

The second warning is about the expression `inch=cm/2.54`. The literal 2.54 is treated as a double precision value. So `cm/2.54` will be a double value as well -- the result of such a computational expression will always be upcast. Although `cm` is of type `float` (single precision), the result will be a `double`. However, `inch` is of type float, so the assignment `=` will implicitly downcast the result from `double` to `float`. Since a `float` variable has less precision, the result will become less precise. To avoid this warning, change the numerical literal, so that the expression looks like this: `inch = cm / 2.54f`. This tells the compiler that 2.54 is to be treated as a single precision `float` literal.