Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot

故事扮演 提交于 2019-12-13 18:01:27

问题


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.


回答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.




回答2:


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.



来源:https://stackoverflow.com/questions/10641006/mixed-mode-assembly-is-built-against-version-v1-1-4322-of-the-runtime-and-cann

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!