How Remove old dll in visual studio? - asp.net

I removed old version Newtonsoft.Json and add new verion . when run program display this error in package.config
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
and in web.config
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
How I can remove completely old verion in visual studio ?

See if there is some remnant in your project.
In the Solution Explorer, right-click on the project and chose "Unload Project". Right-click again and chose "Edit...". Now you see an Xml for your project setup. See if it is calling the older version.

Try this may it help you
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="7.0.0.1" />
</dependentAssembly>
Change newVersion into 7.0.0.1

Related

Getting "Could not load type" error after upgrading to latest Crystal Reports Runtime version 13.0.21.2533

We have a working application, ASP.NET Web forms that uses the Crystal Reports runtime and displays reports in an embedded Print Preview window. It is deployed on a Windows 2012 server and works with CR Runtime v13.0.18 and below.
Today we installed the latest Crystal Reports runtime version 13.0.21.2533 (downloaded from http://www.crystalreports.com/crvs/confirm/) and the Print Preview windows now raises this error:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'MyApp.printPreview1'.
Source Error:
Line 1: <%# Control Language="vb" AutoEventWireup="false"
CodeBehind="printPreview.ascx.vb" Inherits="MyApp.printPreview1"
EnableViewState="true" %> Line 2: <%# Register
Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral,
PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web"
TagPrefix="CR" %> Line 3: Source File:
/MyApp/printPreview.ascx Line: 1
Rolling back to any version prior to v..21 seems to work OK but these older releases have disappeared from SAP/Crystal web site forcing us to use runtime v..21.
This is a breaking change that leaves all reporting in our application non-operational.
After reviewing the Crystal web site about this update here:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
Specifically:
Below items should be highlight for SP21:
...
As most of CR/RAS .NET Assemblies are now re-versioned from 13.0.2000.0 to 13.0.3500.0, user MUST remove all old CR assemblies from Reference list and add the new version of CR assemblies, then
rebuild the application.
a. For those customer/user who do not
wanted to rebuilt their application, there’s workaround to use
<dependentAssembly> in app.config/web.config, please see attachment.
I appears you must a) change your version references to 13.0.3500.0 in web.config and b) rebuild your application in Visual Studio.
This isn't really a practical option for us as we have several in-place installs that will instantly break and a rebuild isn't straightforward with an in-production, live application.
Instead we chose to use the dependentAssembly approach listed in point "4.a" above. Basically all we did was edit the web.config add this block:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Web" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Windows.Forms" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ClientDoc" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonControls" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonObjectModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.Controllers" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.CubeDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.DataDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.DataSetConversion" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ObjectFactory" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.Prompting" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.ReportDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportAppServer.XmlSerialize" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
directly above the closing </configuration> tag, saved, and and the Print Preview window started working.
This has been a viable workaround until we roll out a new release with the newer Crystal Runtime references built into the binaries.

Upgrade newtonsoft.json breaks DNN 9.1 persona bar

I'm trying to integrate SendGrid into my app and it has a dependency on newtonsoft.json.9.0.1. DNN9 ships with newtonsoft.json.7.0.0. However, if I add the binding redirect bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="9.0.1" the site loads, but the persona bar is broken.
I'm completely blocked on this. How do I upgrade newtonsoft?
Try add to webconfig code:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>

Upgrading to MVC 5.2.0.0 causes exception "Method not found: 'Boolean System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp"

I just upgraded to Mvc 5.2.0.0 and started getting this exception when I launch the web app in the browser (IE9):
[MissingMethodException: Method not found: 'Boolean System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp(System.Web.Hosting.VirtualPathProvider, Microsoft.Internal.Web.Utils.IVirtualPathUtility)'.]
[stack trace snipped]
From this MSDN Forums link I understand that it's most probably some older version of System.Web.WebPages.dll lingering around in the "Temporary ASP.NET files" folder. I cleaned the temp ASP.NET files folder but to no avail. I have cleaned and rebuilt the solution, but no luck. I have also checked the references to the DLLs - they are all correctly updated.
My Web.config (relevant section) looks like this:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
</dependentAssembly>
</assemblyBinding>
Reinstalling the Microsoft ASP.NET Web Pages NuGet package will fix your problem:
Install-Package Microsoft.AspNet.WebPages
In my case the problem was in conflict between GAC version and NuGet version, so when I deleted c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages folder, and did rebuild it started to work fine without this exception.
I suppose sometime ago i installed System.Web.WebPages with MVC 4, and when i try to use MVC 5 it still uses version from GAC as it's still have 3.0.0 version and not 3.2 as it has in reality.

Could not load file or assembly Exception from HRESULT: 0x80131040

I created my first MVC 4 project and it works perfectly on local server. But when I publish it on to local folder and upload the folder contents to hosting server. I try to run it and I get this error:
Could not load file or assembly 'DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. The system cannot find the file specified.
Can any one help me please?
Web.config:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
P.S The same project in Web Forms works on hosting server.
Finally found the answer!!
Go to References --> right cilck on dll file that causing the problem --> select the properties --> check the version --> match the version in properties to web config
<dependentAssembly>
<assemblyIdentity name="YourDllFile" publicKeyToken="2780ccd10d57b246" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-YourDllFileVersion" newVersion="YourDllFileVersion" />
</dependentAssembly>
What worked for me immediately was:
I located bin folder (picture below shows).
moved all dll in other folder for safety.
then rebuild ed the project.
after solved the issue, deleted old dll files.
If your solution contains two projects interacting with each other and both using one same reference, And if version of respective reference is different in both projects; Then also such errors occurred. Keep updating all references to latest one.
I had the same issue the NuGet package version was not the same a the one on the references in the project. I had to change the version on the config to match the one in the references from the project. Go to References --> right-click on dll file that causing the problem --> select the properties --> check the version --> match the version in properties to the web config. This should fix the problem.
Add following dll files to bin folder:
DotNetOpenAuth.AspNet.dll
DotNetOpenAuth.Core.dll
DotNetOpenAuth.OAuth.Consumer.dll
DotNetOpenAuth.OAuth.dll
DotNetOpenAuth.OpenId.dll
DotNetOpenAuth.OpenId.RelyingParty.dll
If you will not need them, delete dependentAssemblies from config named 'DotNetOpenAuth.Core' etc..
Try this:
Edit the *.pubxml file in the PublishProfiles folder
set DeleteExistingFiles true
update all nugget packages, rebuild, republish and voila, issue resolved!
...worked for me when I had the same problem.
Check if the project having HRESULT: 0x80131040 error is being used/referenced by any project. If yes, kindly check if these project have similar .dll being referenced and the version is the same. If they're are not of same version number, then it is causing the said error.
I have issue with itextsharp and itextsharp.xmlworker dlls for exception-from-hresult-0x80131040 so I have removed those both dlls from references and downloaded new dlls directly from nuget packages, which resolved my issue.
May be this method can be useful to resolved the issue to other people.
I had the same problem and none of the above solved it.
Web.config was like:
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.9.0" newVersion="5.2.9.0" />
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.9.0" newVersion="5.2.9.0" />
</dependentAssembly>
I added missing dependentAssembly tags and the problem solved. Probably it happened while solving a conflict. This might help someone else's problem.

Manually upgraded a MVC web app from 3 to 4, can't add API Controllers

I upgraded my web app from MVC3 to 4 recently by creating a new web application in MVC4, and copying all the files over, and finally merging the web.config. All works well with the existing web app, however I've just noticed a very weird error today - if I try to create a new API controller with the default dummy implementation, and then browse to that api (e.g. /api/events), I get a Could not load type error. The weird thing is if I rebuild the app, and hit the URL again, it seems to be a different assembly it's complaining about, mainly it alternates between these 2:
Could not load type 'System.Web.Razor.Parser.SyntaxTree.CodeSpan' from assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
and
Could not load file or assembly 'Microsoft.Scripting, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1' or one of its dependencies. The system cannot find the file specified.
My web.config contains the following assembly binding information:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<!--<assemblyIdentity name="FluentValidation" publicKeyToken="a82054b837897c66" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.2.0.0" newVersion="3.2.0.0" />-->
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.0.8.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
And my packages.config looks like it has all the right bits in it:
<package id="AspNetMvc" version="4.0.20126.16343" />
<package id="AspNetRazor.Core" version="2.0.20126.16343" />
<package id="AspNetWebApi" version="4.0.20126.16343" />
<package id="AspNetWebApi.Core" version="4.0.20126.16343" />
<package id="AspNetWebPages.Core" version="2.0.20126.16343" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
<package id="Microsoft.Web.Optimization" version="1.0.0-beta" />
<package id="System.Net.Http" version="2.0.20126.16343" />
<package id="System.Net.Http.Formatting" version="4.0.20126.16343" />
<package id="System.Web.Http.Common" version="4.0.20126.16343" />
<package id="System.Web.Providers" version="1.1" />
<package id="System.Web.Providers.Core" version="1.0" />
I've even tried copying over my web.config with a "vanilla" one from a new mvc4 web app, which still gives me the same error (could not load file or assembly Microsoft.Scripting)
Try removing these lines from your web.config
<dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>

Resources