简体   繁体   English

在 Windows Server 2012 R2 中运行针对 .net framework 1.0 构建的 Windows 服务

[英]Running Windows service built against .net framework 1.0 in Windows Server 2012 R2

I have a .net Windows service built using .net framework 1.0 and using all .net 1.0 assembly references.我有一个使用 .net framework 1.0 并使用所有 .net 1.0 程序集引用构建的 .net Windows 服务。 Now I would like to run that service on a Windows Server 2012 R2, but it does not support .net 1.0.现在我想在 Windows Server 2012 R2 上运行该服务,但它不支持 .net 1.0。 Is there any way to run this service on Windows Server 2012 R2?有没有办法在 Windows Server 2012 R2 上运行这个服务?

I tried to redirect assemblies to .net 2.0 assemblies using assembly redirect in app.config but I'm still receiving error 1053 while starting services and this could be because loading incorrect assemblies.我尝试使用 app.config 中的程序集重定向将程序集重定向到 .net 2.0 程序集,但在启动服务时仍然收到错误 1053,这可能是因为加载了错误的程序集。 Is there any other way to fix this?有没有其他方法可以解决这个问题?

What you are trying to do will not work, which has been stated previously in the comments.您尝试执行的操作将不起作用,这已在之前的评论中说明。
Your only two options are:你只有两个选择:

  1. Recompile the application against a newer supported framework and deal with any remediation that comes from that (broken contracts, deprecated functionality, etc.)针对较新的受支持框架重新编译应用程序,并处理由此产生的任何补救措施(损坏的合同、弃用的功能等)
  2. Run the service on an older version of Server that supports .Net 1.0在支持 .Net 1.0 的旧版服务器上运行该服务

Since you stated that recompiling the code is an option, in my opinion that is by far your best option for many reasons, not the least of which being able to use a supported framework on a supported OS.由于您表示重新编译代码是一种选择,在我看来,出于多种原因,这是迄今为止您的最佳选择,其中最重要的是能够在受支持的操作系统上使用受支持的框架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Windows Server 2012 R2 上构建的应用程序在 Windows Server 2008 R2 上失败 - Application built on Windows Server 2012 R2 fails on windows server 2008 R2 Windows Server 2012 R2上Windows Service Platform上的WCFNotSupportedException - WCF on Windows Service PlatformNotSupportedException On Windows Server 2012 R2 从Excel读取Windows Server 2012 R2上的.net Windows服务 - .net Windows service on windows server 2012 R2 read from excel Windows Server 2012 R2上的意外崩溃WCF服务 - Unexpected crash WCF Service on Windows Server 2012 R2 将 .net core 项目部署到 Windows Server 2012 r2 - Deploy .net core project to Windows Server 2012 r2 Windows Server 2012 r2 中的波斯文化 - Persian culture in Windows Server 2012 r2 Windows Server 2008 R2中未运行quartz.net作业 - quartz.net job not running in windows server 2008 R2 如何使Windows服务从Windows Server 2012 R2中的UI运行 - How to make windows service run from the UI in windows server 2012 R2 如何将bot框架c#代码发布到windows server 2012 r2? - how to publish bot framework c# code to windows server 2012 r2? Blazor 问题部署到 Windows 服务器 2012 R2 — 运行 Visual Studio 2019 - Blazor problem deploying to Windows server 2012 R2 — running Visual Studio 2019
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM