简体   繁体   English

将Web应用程序转换为IIS网站的最佳方法

[英]Best Method for Converting a Web Application into an IIS Website

I have a Web Application and want to move/make it as a IIS website 我有一个Web应用程序,并希望将其作为IIS网站移动/制作

1. Not Copying the DLL 1.不复制DLL

When I copy every part of the code except the Web Application's built DLL file I come up with an error "could not load type ..." 当我复制代码的每个部分,除了Web应用程序的内置DLL文件,我想出了一个错误“无法加载类型......”

2. Copying the DLL 2.复制DLL

cloning that DLL also shouldn't be practical. 克隆那个DLL也不应该是实用的。

If we copy the DLL so the site will work as expected 如果我们复制DLL,那么该网站将按预期工作

but after any changes to code-behind other problems will occur 但在对代码隐藏进行任何更改后,其他问题都会发生

"... does not contain a definition for btnABC_Click() ...." “...不包含btnABC_Click()的定义....”

What should be our decision or strategy in this case 在这种情况下,我们的决定或策略应该是什么?

-- I want to make an IIS-Version of the project because of fixing some addressing-Paths issues - 我想制作项目的IIS版本,因为修复了一些寻址路径问题

thanks in advance 提前致谢

When the Web site runs, ASP.NET code in your Web page doesn't call the C# code that you've written in your code-behind files. 运行Web站点时,Web页面中的ASP.NET代码不会调用您在代码隐藏文件中编写的C#代码。 Rather, it calls a compiled version of that C# code that is in the application's DLL file. 相反,它调用应用程序DLL文件中的C#代码的编译版本。

So the C# code in the code-behind must be compiled after any change into a new version of what you refer to as the "web application's built DLL". 因此,代码隐藏中的C#代码必须在更改为您称为“Web应用程序的内置DLL”的新版本之后进行编译。

Otherwise your Web page will refer to an old version of the DLL, hence the errors "... does not contain a definition for ...". 否则,您的网页将引用旧版本的DLL,因此错误“...不包含...的定义”。

You may want to investigate the walkthrough here: http://msdn.microsoft.com/en-us/library/1y1404zt(v=VS.100).aspx 您可能需要在此处调查演练: http//msdn.microsoft.com/en-us/library/1y1404zt( v = VS.100).aspx

and read the background material here: http://msdn.microsoft.com/en-us/library/377y0s6t.aspx 并在此处阅读背景资料: http//msdn.microsoft.com/en-us/library/377y0s6t.aspx

as they explain in fine detail what you'll need to do. 因为他们详细解释了你需要做什么。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM