[英]ServiceStack.Redis could not be resolved
我寫了這段代碼來創建一個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();
.....
但在嘗試構建解決方案時,我收到了此警告
'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.'
和錯誤
Error3 The type or namespace name 'RedisClient' could not be found (are you missing a using directive or an assembly reference?)
我已經包含了所需的dll ServiceStack.Redis.Can有人解釋如何解決這個問題,我無法理解警告以及需要做些什么來使代碼工作。
您正在構建的.NET配置文件是問題所在。 System.ServiceModel.Web在“客戶端配置文件”中不可用。 在Visual Studio中檢查項目屬性並切換到完整配置文件(即'.NET Framework 4'而不是'.NET Framework 4 Client Profile'),然后重建。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.