I have a wpf c# desktop app that for the last few days has been throwing me this exception when it tries to save data to a sql server database that resides on a dedicated server.
Up until 5 days ago everything was working, and there have been no updates to the app.
The software runs on a Windows 64 bit PC.
Trying to add in the .config file this dependency :
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" />
<bindingRedirect oldVersion="1.0.0.0-11.0.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>
did not give any more errors...
Do you have any idea what could be the cause?
Writing to the database is done with the Entity framework but the Microsoft.SqlServer.Types dll is never used.
Thanks
Related
I am new in C#.
I have created a small windows application with a reference to a my other project dll file that is included in the setup file. I have forwarded the setup to the client.
Now I have few changes in my other project dll.
How do I update this Dll in Client System or How Do I create the patch for the my application with new DLL?
Please help?
NOTE:- I have use Standard Setup Project to create the Setup File.
There are two ways, I can think of immediately:
If you have access to client system, just replace the new dll in the physical load path, assuming this is not a GAC dll and the new dll will get loaded at the runtime
If the assembly is installed in GAC then use something like this in the App.config:
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.5.0.0" newVersion="2.5.0.0" />
I was starting to work on my application which I haven't touched for about a month and when I run the application and try to save a change I get the following error
Could not load file or assembly 'Microsoft.SqlServer.Types,
Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or
one of its dependencies. The system cannot find the file
specified.":"Microsoft.SqlServer.Types, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=89845dcd8080cc91"} System.Exception
{System.IO.FileNotFoundException}
I have no idea why this error is all of a sudden showing up cause the last time I ran this application, I never encountered this problem so I'm at a loss where this is coming from. It happens on the Context SaveChanges event but when the error shows up I can hit the run button again and it will continue on as if nothing happened. After I do that, all successive attempts to save will work without showing the error but if I restart the application, it will show up again. My application is a Windows Form app using .NET Framework and Entity Framework 4 and the database is Sql Server 2005. Any thoughts on what could be causing this problem?
Thanks
I had the same problem where all of a sudden my reports were not coming up.
So i wen to my web.config for the project where your reports view is.
Paste this code as is in the assemblybinding tags.
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<!-- <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" /> -->
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
I saw many threads about this problem but I couldnt find why my application doesnt work.
I want to use other version of Oracle.DataAccess library without recompling application.
I add to app.config lines:
<assemblyBinding>
<dependantAssembly>
<assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342"/>
<bindingRedirect oldVersion="1.0.0.0 - 9.0.0.0" newVersion="10.2.0.100" />
</dependantAssembly>
</assemblyBinding>
If I good understand if I have version between 1.0.0.0 and 9.0.0.0 i force application to use version 10.2.0.100. But always when I change this versions application uses the same dll which was compiled.
My goal is just change dll in local application directory and force application to use this one
We have windows service application which is using Aspose.Words.NET version 11.10.0 Now we have recently upgraded the Aspose.Words dll version latest 13.7.0
Since we have already deployed our windows service applications in multiple clients, we tried replacing the old Aspose.Words dll with latest its latest version. But when we restart the existing windows application it doesn't work with the replaced latest Aspose.Words dll.
We have resolved it by recompiling the whole windows application referencing the latest version of Aspose.Words dll. Are we required to recompile and redeploy our whole windows service application every time we upgrade the Aspose.Words dll?
Check this answer on SO too.
You need to update the config files of the desktop/web clients as follows.
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<publisherPolicy apply="no" />
<assemblyIdentity name="Aspose.Words" publicKeyToken="716fcc553a201e56" />
<bindingRedirect oldVersion="11.0.0.0-13.6.0.0"
newVersion="13.7.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Please also note that there might be breaking changes in API which might lead to other errors. For example a method or property which existed in 11.0 is deleted in 13.7. The exception will be thrown when the client application calls the specific method/property. So, you must verify in development environment that the new version will not break your application. If it works, then you can just replace the old DLL with new version.
The config file is loaded at runtime, so you can update the config files where your applications are deployed.
I work for Aspose as a Developer Evangelist.
Before we were not using Crystal Reports. In our project now we have added Crystal Reports to our project. When I transferred my project to the server it produced a Crystal error.
I suspect that Crystal is not installed on the server. Then installed Crystal 11 on the server. The development machines have Crystal 8.5. The server produces this error at the application startup.
"Could not load file or assembly 'CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified."
Is it possible to have two version
reference in web.config? (i.e. crystal
8.5 & 11)
How can this issue be solved?
Using C#, Visual Studio 2005, and Crystal Reports 8.5 in the development environment.
Best solution is installing same runtime on the server.
Anyway, you can use this XML in your app.config or web.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="xx.x.xxxx.x" newVersion="yy.y.yyyy.y"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="xx.x.xxxx.x" newVersion="yy.y.yyyy.y"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304" culture="neutral"/>
<bindingRedirect oldVersion="xx.x.xxxx.x" newVersion="yy.y.yyyy.y"/>
</dependentAssembly>
<dependentAssembly>
...
</assemblyBinding>
</runtime>
where oldVersion is the version you use for development and newVersion is the version installed on the server
You probably need to add the reference to that DLL in your project (or otherwise get it into your /bin folder.
The error messages says it all, does your server have version 10.2.3600.0 of CrystalDecisions.ReportAppServer.ClientDoc with matching token in either the GAC or somewhere it will be found by your application or web site?
Sounds like you need a config update on the server.
It's just a version conflict, since your development machine is using an earlier version it's looking for that version of the .DLL file when you try to run it on the server. You're probably best off making sure the same version is installed on both your dev machine and the server, and then making sure your web.config using the DLL files from Crystal 11 in both.
The quick hack for now is to figure out the correct file version on the server, and enter that number into the web.config.
EDIT: The other option is to change the version of the .DLL in your web.config on the server, which is basically what the others are saying. The problem there is that you'll have to keep changing it every time you deploy... which would be very annoying. Plus you're testing on the dev machine isn't really valid because you're testing a different program. You're almost guaranteed to see bugs in production that you'll never see in DEV because something's changed between versions.
Is there some reason you can't install Crystal 11 on your dev PC?
No, it is not possible to reference two different versions of the same named assembly.
One way to make this work is to have two different web.config files. One for dev, the other for production. As part of your deployment, simply use the prod version of the file. If your deployment is automated this should be as simple as deleting the dev web.config and renaming the production version after the files have been copied over.
10.2.3600.0 is the version of Crystal Reports that was included with Visual Studio 2005 with the latest patch.
You need to install the Crystal Reports runtime for .net 2.0 on the server. You can obtain the runtime installers from a dev machine
x64
C:\Program Files (x86)\Microsoft Visual Studio 8\Crystal Reports\CRRedist\X64
x86
C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports