Sha*_*mik 3 c# redis servicestack
我写了这段代码来创建一个redis客户端实例
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();
.....
Run Code Online (Sandbox Code Playgroud)
但在尝试构建解决方案时,我收到了此警告
'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.'
Run Code Online (Sandbox Code Playgroud)
和错误
Error3 The type or namespace name 'RedisClient' could not be found (are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
我已经包含了所需的dll ServiceStack.Redis.Can有人解释如何解决这个问题我无法理解警告以及需要做些什么来使代码工作.
您正在构建的.NET配置文件是问题所在.System.ServiceModel.Web在"客户端配置文件"中不可用.在Visual Studio中检查项目属性并切换到完整配置文件(即'.NET Framework 4'而不是'.NET Framework 4 Client Profile'),然后重建.
| 归档时间: |
|
| 查看次数: |
2242 次 |
| 最近记录: |