【问题标题】:failed to publish: could not find required file 'setup.bin' [duplicate]发布失败:找不到所需的文件“setup.bin”[重复]
【发布时间】:2013-07-17 17:14:20
【问题描述】:

我有一个示例控制台应用程序测试 MySQL 连接。代码如下。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data;
using MySql.Data.MySqlClient;

namespace MySQLConnection
{
    class Program
    {
        static void Main(string[] args)
        {
            string connStr = "server=localhost;user=root;database=world;port=3306;password=Password;";
            using (MySqlConnection conn = new MySqlConnection(connStr))
            {
                conn.Open();

                string sql = "SELECT COUNT(*) FROM Country";
                MySqlCommand cmd = new MySqlCommand(sql, conn);
                object result = cmd.ExecuteScalar();

                if (result != null)
                {
                    int r = Convert.ToInt32(result);
                    Console.WriteLine("Number of countries in the World database is: " + r);
                }
            }
            Console.ReadLine();
        }
    }
}

代码运行良好。但是,当我尝试发布项目时,出现如下图所示的错误。

我正在使用面向 .NET 4 的 VS2012 Update 3。有什么想法吗?

谢谢。

更新:

使用这个答案:Could not find required file 'setup.bin' 我能够发布应用程序。

在我的情况下是这样的

  1. HKLM\Software\Microsoft\GenericBootstrapper\11.0\Path 不存在
  2. HKLM\Software\Wow6432Node\Microsoft\GenericBootstrapper\11.0\Path 存在并指向C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\

我从那个目录复制了Engine 目录到我的应用程序目录,然后就可以发布应用程序了。希望不需要每次都这样做。

【问题讨论】:

    标签: c# mysql visual-studio-2012 .net-4.0 publish


    【解决方案1】:

    我建议你用userid property纠正你的字符串连接并添加@

    var connStr = @"server=localhost;userid=root;database=world;port=3306;password=Password;";
    

    【讨论】:

      猜你喜欢
      • 2017-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-25
      • 1970-01-01
      相关资源
      最近更新 更多