调试期间ASP.NET网站编辑停止工作

时间:2015-01-06 23:44:32

标签: asp.net visual-studio

环境:Win7 Pro,VS2013 Utimate,ASP.NET网站,VB.NET

我在运行调试时编辑了vb.net类模块和代码隐藏模块已有好几个月了。

然而,由于没有明显的原因,这在几周/三周前停止了工作。现在,一旦调试开始,代码就会被冻结。我仍然可以编辑aspx页面,js和css,但不能编辑vb.net。

我原本以为这是一个编辑并继续问题但是我终于明白编辑和继续是真正的动态重新编译,其中新编辑的代码实际上被执行了。
所以这是不同的。这是一个网站,再次,我终于理解不够“聪明”足以支持编辑和继续。

我拥有的最佳解决方案是每次都从文件菜单中打开网站,绕过解锁文件在开始窗口中,但是省略了之前调试设置中的所有设置。然后我可以在调试期间编辑。我也可以删除解决方案文件,它具有相同的效果,但不是必需的。但是,只要我保存一个新的解决方案文件(VS每次都要求它)并通过该解决方案文件重新打开该站点,我就无法在调试期间编辑vb.net。

我可以根据需要多次经历这个循环。因此,似乎解决方案文件中的某些内容阻止了调试期间的编辑。

这里讨论了这个问题:

VS 2013 ASP.NET can't modify the code while debugging

但不是专门针对网站与网络应用程序的应用。提到了删除文件。

我建立了一个小型测试网站来证明这个问题。我希望有人看到同样的行为,并想出可能会采取什么措施。或者也许可以解释一下,我要求的是一些特别不适合的东西。 (我考虑过从网站更改为网络应用程序,但是考虑到预算,时间和技能设置在这一点上不是一个好的选择 - 但看起来更好!)

对此有任何建议将不胜感激。谢谢!

webconfig

<?xml version="1.0"?>

<configuration>
    <system.web>
      <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
      <httpRuntime />
    </system.web>

</configuration>

=== page

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label runat="server"
            ID="Label1"
            text="Whoa" />

        <asp:Button runat="server"
            ID ="Button1"
            text ="Test"
            />
    </div>
    </form>
</body>
</html>

====背后的代码

Partial Class Test
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Select Case Me.Label1.Text
            Case "Whoa"
                Me.Label1.Text = "Wow"
            Case "Wow"
                Me.Label1.Text = "Whoa"
        End Select
    End Sub
End Class

=== solutions file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "0005_EnCTest(1)", "http://localhost:2039", "{4B173594-D476-4283-B656-A17B8972BABA}"
    ProjectSection(WebsiteProperties) = preProject
        UseIISExpress = "true"
        TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5"
        Debug.AspNetCompiler.VirtualPath = "/localhost_2039"
        Debug.AspNetCompiler.PhysicalPath = "D:\4500_TESTS\0005_EnCTest\"
        Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_2039\"
        Debug.AspNetCompiler.Updateable = "true"
        Debug.AspNetCompiler.ForceOverwrite = "true"
        Debug.AspNetCompiler.FixedNames = "false"
        Debug.AspNetCompiler.Debug = "True"
        Release.AspNetCompiler.VirtualPath = "/localhost_2039"
        Release.AspNetCompiler.PhysicalPath = "D:\4500_TESTS\0005_EnCTest\"
        Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_2039\"
        Release.AspNetCompiler.Updateable = "true"
        Release.AspNetCompiler.ForceOverwrite = "true"
        Release.AspNetCompiler.FixedNames = "false"
        Release.AspNetCompiler.Debug = "False"
        SlnRelativePath = "D:\4500_TESTS\0005_EnCTest\"
    EndProjectSection
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {4B173594-D476-4283-B656-A17B8972BABA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {4B173594-D476-4283-B656-A17B8972BABA}.Debug|Any CPU.Build.0 = Debug|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal

1 个答案:

答案 0 :(得分:0)

以为我有答案,没有答案

相关问题