내 솔루션 프로젝트 : StoreHelper
및 DefaultsSwitcher
입니다. 둘 다 Windows 실행 파일을 만들어야합니다 (출력은 응용 프로그램입니다).두 개의 WinForms 프로젝트 결합
이제 우리는 StoreHelper
에 있습니다. 내가하려고 할 때
private void defaultsSwitcherToolStripMenuItem_Click(object sender, EventArgs e) {
var defaultsSwitcher = new DefaultsSwitcher.dialog();
defaultsSwitcher.ShowDialog();
}
는 코드 편집기는 밑줄로 오류를 표시하지 않지만, : 파일의 맨 위에
: 이것은 내 코드입니다
using DefaultsSwitcher;
그리고 파일에 빌드하려면 컴파일러에서 다음 오류를 말하십시오.
Error 1 The type or namespace name 'dialog' does not exist in the namespace 'DefaultsSwitcher' (are you missing an assembly reference?) E:\Apps\StoreHelper\StoreHelper\mainWindow.cs 84 25 StoreHelper
어느 것이 문제입니까? 추신 나는이 두 프로젝트를 빌드 한 후 파일 .exe
에 넣기를 원한다.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using StoreHelperLib.Options;
namespace DefaultsSwitcher {
public class dialog : Form {
public dialog() {
var options = new iniHelper();
if (!File.Exists("settings.ini")) {
StreamWriter settings = new StreamWriter("settings.ini");
settings.Close();
}
options.Load("settings.ini");
options.AddSection("Application");
options.SetKeyValue("Application", "firstRun", "true");
options.SetKeyValue("Application", "startGuide", "false");
options.Save("settings.ini");
InitializeComponent();
}
}
}
로컬로 복사 하시겠습니까? 그러면 StoreHelper.exe 옆에'DefaultSwitcher.exe'가 복사됩니다. 하지만 당신은 단지 논리를 DLL로 옮기지 않을 수 있습니까? – Reniuz
'DefaultsSwitcher'를'StoreHelper'의 참조에 추가했습니다 –
하지만 그 참조 속성 인 Copy Local은 true로 설정되어 있습니까? – Reniuz