I created my first WCF RESTful service with just one GetData so I can try, and it works perfectly in localhost, but when I add it to a hosting environment, I get:
Server Error in '/' Application.
Compilation Error
Description:
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'ServiceModel' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Does this means that I need to place the dll in the GAC to this work? Shouldn't work in the BIN forlder of my Service?
Here is how my service folder looks like:
Service.svc
Service.svc.cs
web.config
BIN
Microsoft.ServiceModel.Web.dll
Microsoft.ServiceModel.Web.pdb
MyService.dll
MyService.pdb
PROPERTIES
AssemblyInfo.cs
Line 4: using System.ServiceModel; Line 5: using System.ServiceModel.Activation; Line 6: using Microsoft.ServiceModel.Web; Line 7: Line 8: namespace MyService
and the dll is in the BIN folder.
I have no idea what to wrte in the web.config (if I need to write something)
balexandre
Member
71 Points
19 Posts
Does Microsoft.ServiceModel.Web only work in GAC?
Jan 20, 2009 11:08 PM|LINK
Hi guys,
I created my first WCF RESTful service with just one GetData so I can try, and it works perfectly in localhost, but when I add it to a hosting environment, I get:
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.Compiler Error Message: CS0234: The type or namespace name 'ServiceModel' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
Does this means that I need to place the dll in the GAC to this work? Shouldn't work in the BIN forlder of my Service?
Here is how my service folder looks like:
What can I do in order to make this working?
Thank you.
Bruno Alexandre
(a Portuguese in Denmark)
balexandre
Member
71 Points
19 Posts
Re: Does Microsoft.ServiceModel.Web only work in GAC?
Jan 21, 2009 12:32 AM|LINK
got the problem...
I am not configuring the DLL in the web.config file.
But how can i add this, what's the code? in <appSettings>?
Bruno Alexandre
(a Portuguese in Denmark)
Amit Sharma
Member
28 Points
14 Posts
Re: Does Microsoft.ServiceModel.Web only work in GAC?
Jan 21, 2009 08:28 PM|LINK
the web dll need not be gaced. Just having it in the bin should be fine.
Can you check if you have referenced the web dll correctly?
balexandre
Member
71 Points
19 Posts
Re: Does Microsoft.ServiceModel.Web only work in GAC?
Jan 24, 2009 07:20 AM|LINK
I did, and it works fine locally :(
and the dll is in the BIN folder.I have no idea what to wrte in the web.config (if I need to write something)
Bruno Alexandre
(a Portuguese in Denmark)
Amit Sharma
Member
28 Points
14 Posts
Re: Does Microsoft.ServiceModel.Web only work in GAC?
Jan 24, 2009 04:57 PM|LINK
what version of the .net framework is installed on your machine?
How are you hosting the service? IIS?
Can you give a quick shot to self hosted service and see if the problem is IIS or something else.
James Osborn...
Member
70 Points
30 Posts
Re: Does Microsoft.ServiceModel.Web only work in GAC?
Feb 04, 2009 05:21 PM|LINK
I'm pretty sure there's nothing you need to write in the web.config folder as long as the dll is in Bin.