Use EF 6.0 SaveChanges() function causes error "Could not load file or assembly " oracle. manageddataaccessdtc, version=4.122.19.1" - asp.net

I use Oracle.ManagedDataAccess nuget packet, I publish the project to IIS, everything it ok, but if I call the EF function SaveChanges(), I get this error:
Could not load file or assembly Oracle.ManagedDataAccessDTC, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342 Or one of its dependencies,Find the assembly manifest definition does not match the assembly reference. ( exception from hresult:0x80131040 )
I put the Oracle.ManagedDataAccessDTC.dll in the publish folder in the bin directory, but I still get the error.
Please give me some advice! Thanks!

Related

Alachisoft.NCache.Web.SessionState.NSessionStoreProvider can't find protobuf-net

I've downloaded the open source edition of ncache and i've followed the instructions at http://www.alachisoft.com/resources/docs/ncache/help/aspnet-session-state-provider.html?mw=Mzk2&st=MQ==&sct=MTk4&ms=QwAAEAAAIAAAAQACATgIAhA=
to configure my website to put the session state in ncache.
However, i get this error hitting the site.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'protobuf-net, Version=1.0.0.282, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 136:
Line 137:
Source File: C:\inetpub\wwwroot\xxxx\web.config Line: 138
Assembly Load Trace: The following information can be helpful to determine why the assembly 'protobuf-net, Version=1.0.0.282, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' could not be loaded
I'm not sure where to find that dll or why it can't be loaded? I tried using nuget to install protobuf-net but there is no 1.0.0 version and the recent version does not fix the problem when i copy it to the bin folder.
Randy
Turns out the issue was that you need NCache installed on the web servers too, in addition to the cache servers. This is a better page to follow if you are just starting out with NCache for sessionState.
http://www.alachisoft.com/resources/docs/ncache/ncache-session-guide.pdf

Application cannot load Microsoft.SqlServer.Types Version 13

I am having a problem that many people have had before but none of the existing answers seem to work for me.
When I deploy my ASP.NET project I get an error in the event log saying
Could not load file or assembly 'Microsoft.SqlServer.Types, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
To try to rectify this I installed the Nuget package:
PM> Install-Package Microsoft.SqlServer.Types
This didn't work and I get the same error. So then I followed the readme and used Loader.cs to load the files. Again, same problem. What is happening and why don't the usual solutions fix it?
One thing I did note is that my Microsoft.SqlServer.Types.dll is version 11 not 13? If it makes any difference our database is SqlServer 2016 and our machine is running Windows Server 2008
The way I solved this was to to set the SqlServerTypesAssemblyName in my app. I currently set it in my EntityContext constructor [that inherits off DbContext] to ensure its always set
SqlProviderServices.SqlServerTypesAssemblyName
= "Microsoft.SqlServer.Types, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91";
Note your version may want to be different.
Make sure you are reference the correct version of assembly.
If not add manually.
Once the nuget package is installed you can ensure that the dll reference property is set to 'copy local = true'

MVC, Compile Error with Compiled App_Code

I have some classes in App_Code that are not accessible unless I change them from Content to Compiled. Once I change them to Compiled, I start getting error messages and warnings that aren't making any sense to me.
1:
Severity Code Description Project File Line
Warning CS0436 The type 'Article' in 'C:\Users\Ken\OneDrive\Web site\Choatech\App_Code\Article.cs' conflicts with the imported type 'Article' in 'choatech, Version=2015.7.5693.41559, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\Ken\OneDrive\Web site\Choatech\App_Code\Article.cs'. Choatech C:\Users\Ken\OneDrive\Web site\Choatech\App_Code\SQLProvider.cs 12
2:
Severity Code Description Project File Line
Error CS0433 The type 'SQLProvider' exists in both 'choatech, Version=2015.7.5693.41559, Culture=neutral, PublicKeyToken=null' and '1_App_Code, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Choatech C:\Users\Ken\OneDrive\Web site\Choatech\Views\Article\Index.cshtml 24
I understand it's trying to tell me that the item exists twice, but it's referencing the same file both times in the first error... Which isn't making sense to me.
In the second error it's listing some error that appears to be in the project file itself...
Changing the classes to Content resolves the errors, but then my code isn't accessible throughout my application.
I am using MVC, if that makes any difference.
Thanks.
Don't put these files in App_Code. Source code kept in the App_Code folder is automatically compiled at runtime, resulting in the CS0436 warnings that you are seeing.

The type or namespace name 'ViewPage' does not exist in the namespace 'System.Web.Mvc'

I have a solution (VisualStudi0 2013) that worked perfectly well until couple of days ago. Suddenly after I had restarted my computer I started getting the following error locally everytime I run the debugger. There are no errors in the solution itself but only in the browser. I'm able to clean, build, rebuild and publish the solution without any problems. In fact the solution works well on-line but not locally on my computer.
Another fact is that the aspx files are debugged without any error. It's only the pages that are served with MVC that throws this error.
I searched for the ViewPage and it only exists in the web.config.
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXXXX"
I'm certain that the ViewPage is available in the solution references under the 'System.Web.Mvc' but why I'm getting this error in a file in the Temporary ASP.NET Files. I cleared the temp files but it didn't help.
Compiler Error Message: CS0234: The type or namespace name 'ViewPage' does not
exist in the namespace 'System.Web.Mvc' (are you missing an assembly reference?)
Source Error:
Line 136: public class views_home_index_aspx : global::System.Web.Mvc.ViewPage, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\6f597118\63e8eef9\App_Web_index.aspx.a8d08dba.6ujukvge.0.cs Line: 136
That was caused by a Security Update. I fixed it by setting CopyLocal to true on the System.Web.Mvc reference but you can get more details at http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx

Type or namespace is not found Error when deploying the website

the website works nice on local system but when I deploy it , an exception throws that :
CS0234: The type or namespace name 'ISisoDatabase' does not exist in the namespace 'SisoDb' (are you missing an assembly reference?) ?
it's a shared host by the way .
any idea why this is happening ?
Edit : I used Web Project instead of WebSite and this error is gone but another exception is thrown :
Could not load file or assembly 'SisoDb, Version=15.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The module was expected to contain an assembly manifest.
solved : the problem was the ftp client I used to upload dlls . it sounds ftp corrupted the dlls. when I added assemblies using file manager , the problem was solved
the problem sometimes is the ftp client that is used to deploy files .they corrupt files when uploading them . try uploading files using file manager .

Resources