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.
to warning `C4996`  

at vs 2010, especially at vs 2012.  

you have to put the the following code at the top of the file

```
#define _CRT_SECURE_NO_WARNINGS  

```

And set the precompiled header option to "not using" at the project's property page.