Question

I am trying to get a windows service to work but I keep getting the following error... Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

The windows service is pretty simple. It looks at some data, does some organization and sends some information of to a database. If the data meets certain conditions, the service connects to K2 Workflow, find the correct item, then claims and completes the item.

My problem comes about when trying to connect to K2 in an assembly which was build with .NET 1.1. I have tried adding

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

to any and all config files in my project but it does not work. The peculiar thing is that when I run the service in debug mode and step through, I have no problems and everything works fine, but when I install and run it as a service, this issue comes up.

I have checked to make sure that the config is getting copied when I install it, but I am just stumped now because the only thing I can find anywhere is the configuration addition which doesnt seem to be solving my problem.

Was it helpful?

Solution

I figured out my problem. It turns out it had to do with the framework that I was using. I thought that my service exe was myservice.exe so I named my config file myservice.exe.config. Upon further investigation, I found out that the service was inheriting from a base service class and that the executable was named serviceshell.exe so my config file needed to be named serviceshell.exe.config.

OTHER TIPS

Can you give some details about the assemblies you're using. The K2 assembly you should be using is SourceCode.Workflow.Client, which simply should work with all .net versions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top