【问题标题】:Problem in publishing a solution in Visual Studio 2008在 Visual Studio 2008 中发布解决方案时出现问题
【发布时间】:2011-09-02 22:07:05
【问题描述】:

我有一个包含 2 个项目的解决方案,我想发布此应用程序。当我尝试安装时,我遇到了问题。它说它找不到我正在使用的 txt 文件。在我的应用程序中,我还使用了 2 个其他 txt 文件,并且它没有显示关于这 2 个 txt 文件的问题。错误如下所示。有谁知道问题可能是什么?提前谢谢!

有关调用的详细信息,请参阅此消息的末尾 即时 (JIT) 调试,而不是此对话框。

************** Exception Text **************
System.IO.FileNotFoundException: Could not find file 'C:\Users\Δημήτρης\AppData\Local\Apps\2.0\16302ORR.AW8\MB0AX4OD.0OL\auth..tion_4deb94c49aed6906_0001.0000_30081526368df596\checkStatus.txt'.
File name: 'C:\Users\Δημήτρης\AppData\Local\Apps\2.0\16302ORR.AW8\MB0AX4OD.0OL\auth..tion_4deb94c49aed6906_0001.0000_30081526368df596\checkStatus.txt'
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
   at System.IO.StreamReader..ctor(String path, Boolean detectEncodingFromByteOrderMarks)
   at AuthenticationApplication.Form1.Form1_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5444 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
AuthenticationApplication
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Δημήτρης/AppData/Local/Apps/2.0/16302ORR.AW8/MB0AX4OD.0OL/auth..tion_4deb94c49aed6906_0001.0000_30081526368df596/AuthenticationApplication.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

***** JIT 调试 ** ***** 要启用即时 (JIT) 调试,为此的 .config 文件 应用程序或计算机 (machine.config) 必须具有 在 system.windows.forms 部分设置的 jitDebugging 值。 应用程序还必须通过调试进行编译 已启用。

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

启用 JIT 调试后,任何未处理的异常 将发送到计算机上注册的 JIT 调试器 而不是被这个对话框处理。

【问题讨论】:

    标签: c# visual-studio visual-studio-2008


    【解决方案1】:

    文件不存在。

    文件是在运行时创建的?

    如果没有将它们包含在您的解决方案中并将它们标记为“内容”并选择复制选项“始终复制”、“如果新则复制”、“不要复制”。

    【讨论】:

    • 我包含了所有三个文本文件并将它们标记为内容并始终被复制。问题依旧……
    • 文件不是在运行时创建的,我自己创建的。
    • 我想补充一点,发布阶段是成功的。在此之后,当我尝试安装应用程序时,出现此错误...
    • 您是否使用单击一次发布进行部署。检查文件是否包含项目属性/发布属性/应用程序文件。同样在发布选项上,在部署时取消选中“使用 .deploy 文件扩展名。
    【解决方案2】:

    检查有效文件和无效文件的属性。很有可能您设置了问题文件,因此它不会复制,这会导致不发布。

    【讨论】:

    • 我包含了所有三个文本文件并将它们标记为内容并始终被复制。问题依旧……
    • 我想补充一点,发布阶段是成功的。在此之后,当我尝试安装应用程序时,出现此错误...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多