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.
Related
I can't figured out how to use a publisher policy correctly and I seem to have an similiar issue as related to:
How to make Publisher Policy file redirect assembly request
I've created shared assemply named "SharedAssembly.dll" in version "1.0.0.0", and then in version "2.0.0.0". Both are instaled in GAC (MSIL_GAC, target is .NET Framework 4.5).
I've created following publisher policy file *.xml (redirecting to an older version "1.0.0.0" is on purpose behaviour):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="SharedAssembly"
publicKeyToken="89f6ea550599ca14"
culture="neutral"/>
<bindingRedirect oldVersion="2.0.0.0"
newVersion="1.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Then I've created the publisher policy assembly using the command:
al /link:App.config /out:policy.2.0.SharedAssembly.dll /keyf:F:\VisualStudio\klucz.snk /v:1.0.0.0 /platform:anycpu
Of course, I installed it into GAC.
Then I created a new Console Application, I added reference to the "SharedAssembly.dll", but it doesn't work :(
It still connects with the 2.0.0.0 version of my shared assembly.
I tried many advices, as using fuslogvw.exe (no errors shown), getting rid of the "culture" attribute, etc., but it doesn't help.
I think the problem is not that I want to point to the older version of .dll?
Please help me to fix that issue, cause I've tried so many things and yet I can't make it work.
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
I am working on a project that references dlls from another product. The product has a release each year and the assemblies version changes for each one, although the methods stay the same.
When I run a build of my project for 2010 when I try and run it for 2009 it throws an error because it is dependent on a different version. Is there a way around this?
If you're referring to a problem at runtime after swapping versions of your assembly without performing a rebuild of the program referencing your newly built assembly, you'll want to use a <bindingRedirect> directive to your program's App.config (or Web.config, if you're talking about a web site.)
bindingRedirect is used to instruct the .NET Framework that it's OK to use a version of an assembly other than the one the application was originally compiled against. By default, the CLR wants to see the same version of a DLL that your application was referencing during build, and if it doesn't it will throw an exception.
Try selecting the reference, and in property window set Specific Version as false.
It is possible to map different .net version of assembly in app.config that you put in application root folder
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Waters.ACQUITY.Remote"
publicKeyToken="6c13fd0b3604de03"
culture="neutral" />
<bindingRedirect oldVersion="1.40.0.0"
newVersion="1.60.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
This is solution when assembly you have referenced has references inside it to another specifc library version.
It happens when at compilation time "Specific version" is set to true. To avoid this problem it should be false.
I have a dll. That dll is uploaded on a server. I want that each time the application starts to get the "latest" dll from the server, so I've used the following code in my app.config. Why isn't it working?
here is the app.config file:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="ReflectionTest"
publicKeyToken="f94c9b9f0707ee96"
culture="neutral" />
<codeBase version="1.0.0.0"
href="http://127.0.0.1/ReflectionTest.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
First, you may be on the wrong track. Even if you didn't change the version, your application may end up using an older copy of the assembly.
Assuming a valid URI in your <codebase> element, when your application runs for the first time, the runtime will not find the assembly in until it probes your codebase. Then, it will download the assembly to the GAC. When your application runs again, the runtime will find that assembly in the GAC, so it will not need to probe for it.
Instead of using <codebase>, consider using Reflection. Specifically, you might want to use Assembly.LoadFrom(assemblyUri) in your application, getting the URI from an application setting. From there, you'd create objects using the Reflection API, particularly using Activator.CreateInstance<T>().
As for getting that assembly from your server is concerned, make sure that your DLL is in the right location and that your web server is running and properly configured.
Is your .dll actually available at that location? Are you serving it up through some web application?
If you type that URL into a web browser, does it let you download or open that file?
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