The type or namespace name 'Syndication' does not exist in the namespace 'System.ServiceModel' After updating to VS2010

StackOverflow https://stackoverflow.com/questions/9195530

  •  27-04-2021
  •  | 
  •  

i get the following error when trying to compile my asp.net site after updating the project from vs2008 to vs2010

The type or namespace name 'Syndication' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?)

I have the asp.net site targeting 3.5 framework (as it did in vs2008) I also added a reference to System.ServiceModel.Web

I also have these using statements at the top of my class: using System.ServiceModel; using System.ServiceModel.Description; using System.ServiceModel.Syndication; using System.ServiceModel.Web;

The last 2 complain with the error above, commenting them out produces errors (cannot find WebGet, etc.) like it flipflops.

Anyone have any ideas?

有帮助吗?

解决方案 4

remembered a kinda similar thing in the past, i fixed it by continuously changing the target between 2,3,3.5 until it worked - yes you heard me right. My guess is it took a time or two from one version to the next for it to self-fix the config file.

其他提示

I got this working in .NET 3.5 by adding the Web DLL, thanks to the post below.

DOTNET 3.5: add a reference to the System.ServiceModel.Web.dll

DOTNET 4.0: add a reference to the System.ServiceModel.dll

StackOverflow Post

For me it turned out to be the following line:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

it should have been

<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">

I had many other projects in the solutions all based off the same thing - no idea how that went missing but adding it in solved the problem.

Try deleting any references in question and then re-adding them afresh and compile. Does the same happen?

If you get this in Visual Studio 2010, I found cleaning your solution, closing Visual Studio and restarting it solved the intellisense issue.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top