简体   繁体   English

在不预编译源代码的情况下执行IIS .NET Webforms网站

[英]Execute IIS .NET webforms website without precompiling the source code

I want to publish to IIS the source code of my website (visual studio 2017 web forms website in vb.net or c#) without pre-compiling the project, so I can modify the source code directly on the server with IIS. 我想在不预编译项目的情况下将我的网站的源代码(vb.net或c#中的Visual Studio 2017 Web表单网站)发布到IIS,因此可以直接在具有IIS的服务器上修改源代码。

I know this is possible, I have done it in the past, and I have seen it done even now, but I cannot figure out what I need to do for this. 我知道这是可能的,我过去已经做到了,甚至现在都已经看到了,但是我无法弄清楚为此需要做些什么。

When I copy all the website source code to the server with the IIS, the website does not run... any ideas? 当我使用IIS将所有网站源代码复制到服务器时,该网站无法运行...有什么想法吗? or where to look for an answer? 或在哪里寻找答案? Is it a matter of setup? 这是设置问题吗? of the type of project? 项目类型?

When I call the website I get the following error: 当我致电该网站时,出现以下错误:

Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. 配置错误描述:处理服务于此请求所需的配置文件时发生错误。 Please review the specific error details below and modify your configuration file appropriately. 请查看下面的特定错误详细信息,并适当修改您的配置文件。

Parser Error Message: The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located. 解析器错误消息:无法找到CodeDom提供程序类型“ Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider,Microsoft.CodeDom.Providers.DotNetCompilerPlatform,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”。

Source Error: 源错误:

An application error occurred on the server. 服务器上发生应用程序错误。 The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). 该应用程序的当前自定义错误设置阻止应用程序错误的详细信息被远程查看(出于安全原因)。 It could, however, be viewed by browsers running on the local server machine. 但是,可以由运行在本地服务器计算机上的浏览器查看它。

Thanks! 谢谢!

@Gabe Thanks for the directions: @Gabe感谢您的指示:

File - New Project, I see it under Visual Basic/Visual C# - Web - Previous Versions (ASP.NET Web Forms Site) 文件-新项目,我在Visual Basic / Visual C#下看到它-Web-以前的版本(ASP.NET Web窗体站点)

I tried it, and it works just fine! 我试过了,效果很好! Basically if you create a project like you describe, you can just copy the source code in a server, without even installing visual studio there, and you can develop the site directly there. 基本上,如果您按照描述的方式创建项目,则只需将源代码复制到服务器中,甚至无需在其中安装Visual Studio,就可以直接在该网站上开发站点。

This is ideal when you want to test things directly with external users, test things directly on the live or test servers, and of course you can make sure you have the source code of the project running, without having to keep both the source code and the compiled version. 当您想直接与外部用户进行测试,直接在实时或测试服务器上进行测试时,这是理想的选择,当然,您可以确保已运行项目的源代码,而不必同时保留源代码和编译版本。

There are a few drawbacks though: 1) you disrupt the website when you change things, and the application pool is restarted whenever there are changes, users in sessions are kicked out, etc... 2) there is a small delay while the site gets recompiled 3) there are cases where if while the code gets recompiled there are users online, there is asp.net corruption 但是有一些缺点:1)当您进行更改时您破坏了网站,并且每当发生更改时应用程序池就会重新启动,会话中的用户会被踢出,等等... 2)网站稍有延迟重新编译3)在某些情况下,如果重新编译代码时有用户在线,则会导致asp.net损坏

Thanks for the replies!! 感谢您的答复! Regards Manos 问候马诺斯

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

相关问题 预编译 ASP.NET Webforms 站点以供 IIS 提供服务 - Precompiling an ASP.NET Webforms site for serving by IIS 创建独立于asp.net webforms中的源代码的网站模板 - Creating website template which is independent from source code in asp.net webforms 在IIS上发布网站或IIS启动后如何执行页面或代码 - How to execute Page or Code after website is published on IIS or IIS starts 可视化测试 ASP.NET WebForms 网站中的异常代码路径 - Visually testing unusual code paths in ASP.NET WebForms Website 安全审计问题 [For Asp.Net WebForms]:源代码公开 - Security Audit Issue [For Asp.Net WebForms] : Source code disclosed 保护ASP.NET网站的源代码 - Protect source code of an ASP.NET website ASP.NET(WebForms或MVC)应用程序中的哪个代码组件提供图像等网站资源? - Which code component in an ASP.NET (WebForms or MVC) application serves website resources such as images? 将 .net 代码添加到 asp webforms 网站,无法在 .dll 文件中引用命名空间 - adding .net code to a asp webforms website, can't reference namespaces in .dll file Webforms应用程序内的ASP.NET网站? - ASP.NET Website inside Webforms application? 用于 ASP.NET Webforms 网站的 Azure Pipeline - Azure Pipeline for ASP.NET Webforms WebSite
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM