简体   繁体   中英

ServiceStack.Redis could not be resolved

I wrote this code to create a redis client instance

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ServiceStack.Redis;
using ServiceStack;



class Program
{
    static void Main(string[] args)
    {
        RedisClient a = new RedisClient();
         .....

But when trying to build solution i am getting this warning

'The referenced assembly "ServiceStack.Redis" could not be resolved because                                   it has a dependency on "System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.'

and the error

Error3 The type or namespace name 'RedisClient' could not be found (are you missing a   using directive or an assembly reference?)

I have included the required dll ServiceStack.Redis.Can someone explain how to get around this problem i cant understand the warning and what needs to be done to make the code work.

The .NET profile you're building against is the issue. System.ServiceModel.Web isn't available in 'Client Profile'. Check your project properties in Visual Studio and switch to the full profile (that is '.NET Framework 4' not '.NET Framework 4 Client Profile'), then rebuild.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM