-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web项目中redis初始化出错 #71
Comments
你用的是 .net framework v4.0 啊? Newtonsoft.Json, Version=11.0.0.0,提示找不到这个程序集 |
生成这个文件的是在类库项目里面,之前单独测试的时候只与package文件呀,在项目中就可多出这个文件了 |
这个是web.config里面更新的,两个文件里面的Json版本不一样 |
确定是版本不一致导致的错误吗? |
可以考虑把源代码加到项目中开发 |
好的 |
整理了一下.net framework4.5的源码,编译通过了 |
好的,试试 |
你用的还是CSRedisCore项目吧,引用CSRedisNFX45吧 |
new CSRedis.CSRedisClient("xxxxxx:63140,name=test,password=pen1234Q~,poolsize=3") new CSRedis.CSRedisClient("xxxxxxx:63140,name=test,password=pen1234Q~,poolsize=3") |
好的,谢谢 |
“new CSRedis.CSRedisClient("xxxxx:63140,name=test,password=pen1234Q~,poolsize=3")”引发了类型“System.IO.FileLoadException”的异常
|
你可以修改为你主程序中引用的版本,csredis没有其他依赖引用了,只有这一个 |
谢谢大佬 |
你好,请问现在的版本是可以直接在NuGet里面引用,而不需要修改Newtonsoft的版本了吗 |
你那边是不是还是 json.net 11.0 的问题 |
这边没问题,只是项目负责人说直接从NuGet上引用,之后可以方便升级,但是我们用的json还是之前的低版本版本。 |
var csRedis = new CSRedis.CSRedisClient("xxxxxx:63140,name=test,password=pen1234Q~,poolsize=3"); RedisHelper.Initialization(csRedis);
引发的异常:“System.IO.FileLoadException”(位于 CSRedisCore.dll 中)
“var csRedis = new CSRedis.CSRedisClient("xxxxxx:63140,name=test,password=pen1234Q~,poolsize=3"); RedisHelper.Initialization(csRedis)”引发了类型“System.IO.FileLoadException”的异常
Data: {System.Collections.ListDictionaryInternal}
FileName: "Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"
FusionLog: "=== Pre-bind state information ===\r\nLOG: DisplayName = Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed\n (Fully-specified)\r\nLOG: Appbase = file:///E:/contentOfWork/Speedster/Speedster.Web/\r\nLOG: Initial PrivatePath = E:\contentOfWork\Speedster\Speedster.Web\bin\r\nCalling assembly : CSRedisCore, Version=3.0.30.0, Culture=neutral, PublicKeyToken=null.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: Using application configuration file: E:\contentOfWork\Speedster\Speedster.Web\web.config\r\nLOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config\r\nLOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.\r\nLOG: Post-policy reference: Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed\r\nLOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET
Files/speedster.web/c61e2095/be700bd4/Newtonsoft.Json.DLL.\r\nLOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/speedster.web/c61e2095/be700bd4/Newtonsoft.Json/Newtonsoft.Json.DLL.\r\nLOG: Attempting download of new URL file:///E:/contentOfWork/Speedster/Speedster.Web/bin/Newtonsoft.Json.DLL.\r\nWRN: Comparing the assembly name resulted in the mismatch: Major Version\r\nERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.\r\n"
HResult: -2146234304
HelpLink: null
IPForWatsonBuckets: 0x008c10e5
InnerException: null
IsTransient: false
Message: "Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
RemoteStackTrace: null
Source: "CSRedisCore"
StackTrace: " 在 CSRedis.CSRedisClient..ctor(Func
2 NodeRule, String[] connectionStrings)\r\n 在 CSRedis.CSRedisClient..ctor(String connectionString)" TargetSite: {Void .ctor(System.Func
2[System.String,System.String], System.String[])}WatsonBuckets: null
_HResult: -2146234304
_className: null
_data: {System.Collections.ListDictionaryInternal}
_dynamicMethods: null
_exceptionMethod: {Void .ctor(System.Func`2[System.String,System.String], System.String[])}
_exceptionMethodString: null
_fileName: "Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"
_fusionLog: "=== Pre-bind state information ===\r\nLOG: DisplayName = Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed\n (Fully-specified)\r\nLOG: Appbase = file:///E:/contentOfWork/Speedster/Speedster.Web/\r\nLOG: Initial PrivatePath = E:\contentOfWork\Speedster\Speedster.Web\bin\r\nCalling assembly : CSRedisCore, Version=3.0.30.0, Culture=neutral, PublicKeyToken=null.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: Using application configuration file: E:\contentOfWork\Speedster\Speedster.Web\web.config\r\nLOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config\r\nLOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.\r\nLOG: Post-policy reference: Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed\r\nLOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET
Files/speedster.web/c61e2095/be700bd4/Newtonsoft.Json.DLL.\r\nLOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/speedster.web/c61e2095/be700bd4/Newtonsoft.Json/Newtonsoft.Json.DLL.\r\nLOG: Attempting download of new URL file:///E:/contentOfWork/Speedster/Speedster.Web/bin/Newtonsoft.Json.DLL.\r\nWRN: Comparing the assembly name resulted in the mismatch: Major Version\r\nERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.\r\n"
_helpURL: null
_innerException: null
_ipForWatsonBuckets: 0x008c10e5
_maybeFullPath: null
_message: "Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
_remoteStackIndex: 0
_remoteStackTraceString: null
_safeSerializationManager: {System.Runtime.Serialization.SafeSerializationManager}
_source: "CSRedisCore"
_stackTrace: {sbyte[48]}
_stackTraceString: null
_watsonBuckets: null
_xcode: -532462766
_xptrs: 0x00000000
环境:window10, visual studio2017. .net Framework4.7
The text was updated successfully, but these errors were encountered: