1

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.

wallyk
  • 56,922
  • 16
  • 83
  • 148
ninja coder
  • 1,067
  • 9
  • 22

2 Answers2

1

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.

ninja coder
  • 1,067
  • 9
  • 22
  • Congrats on the fix! When you are able, please make sure to mark your answer as 'accepted' (using the green checkmark) so that others will be able to learn from your success. Cheers~ – Andrew Kozak May 18 '12 at 15:03
  • I have to wait for tomorrow until it will let me accept my own answer. Also, this has been an issue for me for several weeks that I have been trying to figure out, which is why I posted it here. I didn't mean to post and answer within a day but sometimes it just happens, I guess. – ninja coder May 18 '12 at 16:25
  • Not a problem at all: http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/ Glad you got it resolved. – Andrew Kozak May 18 '12 at 16:51
0

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.

cyclops
  • 64
  • 2