繁体   English   中英

应用程序从 IIS 8.5 (Win Server 2012 R2) 迁移到 IIS 10 (Win Server 2016) ASP.NET 页面和 VB.NET 代码的问题

[英]Application migration from IIS 8.5 (Win Server 2012 R2) to IIS 10 (Win Server 2016) problem with ASP.NET page and VB.NET code

我到处寻找建议,但没有找到任何东西:(我的问题存在于使用VB.NET代码创建的 ASP.NET 应用程序的页面中,在从带有 IIS 8.5 的 Windows Server 2012 R2迁移到带有 IIS10 的 Windows Server 2016 之后在网络上浏览时,只有这个页面给了我错误。

当我通过从 IIS 执行“浏览”来运行测试时没问题。我得出的结论是,在页面代码(我在下面报告)中,出于安全原因, IIS10不再识别某些行。

你能告诉我你是否注意到了一些奇怪的事情吗? 我在下面报告EVENT VIEWER报告的错误的详细信息; 似乎错误在第 28 行

事件查看器错误:

异常信息: 异常类型:IOException 异常消息:指定的服务器无法执行请求的操作。

在 System.IO.__Error.WinIOError(Int32 errorCode, String MaybeFullPath) 在 System.IO.FileSystemEnumerableIterator 1.CommonInit() 在 System.IO.FileSystemEnumerableIterator 1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler `1 resultHandler, Boolean checkHost) at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption) at it_prod_ship_xmlparser_it.Page_Load(Object sender, EventArgs e) in C:\\inetpub\\wwwroot\\drivetools\\it\\prod\\ship\\xmlparser_it .aspx.vb:第 28 行在 System.Web.UI.Control.OnLoad(EventArgs e) 在 System.Web.UI.Control.LoadRecursive() 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Imports System.Data
Imports System.Linq
Imports System.Xml.Linq
Imports System.IO
Imports System.Xml
Imports System.Data.SqlClient
Imports System.Net
Imports System.Security.Principal
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Security
Imports System.Text
Imports System.Security.Cryptography
Imports System.Drawing

Partial Class it_prod_ship_xmlparser_it
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Page.IsPostBack Then
        Session("utente") = UCase(funzioni.usr)
        If Session("utente") = "ITXXXXXX" Or Session("utente") = "ITXXXXXX" Then
            btnXML.Enabled = False : btnBart.Enabled = False : btnTrackC.Enabled = False
            btnLbl.Enabled = False : btnTel.Enabled = False : btnTrack.Enabled = False
            AsyncFileUpload1.Enabled = False : gvXML.Enabled = False
        End If
        Dim folder As New DirectoryInfo("\\servercompany.it.company\drivefiles\xmlfiles")
        Dim listfile As FileInfo() = folder.GetFiles("*.xml")
        If listfile.Length = 0 Then
            btnXML.Enabled = False
        Else
            Dim fsize As Double = 0
            For Each f As FileInfo In listfile
                fsize += f.Length
            Next
            btnXML.Text = "Importa (" & listfile.Length & " - " & Math.Round(fsize / 1024 / 1000, 1) & " Mb)"
        End If

    End If

End Sub

预先感谢您提供给我的所有信息

我要感谢所有回复并提供重要信息以分析问题的人。 经过几个月让我发疯的尝试,我发现我的问题是由新的安全设置引起的:从“Windows Server 2012 R2”切换到“Windows Server 2016”时,安全功能“DEVICE GUARD”和“CREDENTIAL” GUARD”在所有需要访问网页的客户端上执行,而这些网页又需要 DELEGATION 权限(例如,当需要以打开 Web 应用程序的用户的名义浏览网络文件夹时)。 我通过在验证应用程序的服务器上设置正确的 SPN 解决了​​这个问题。 再次感谢大家

暂无
暂无

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

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