0

VS2010 には 2 つのプロジェクトがあります。最初のものは、DLL を持つ 2 番目のものに依存する GUI です。私はそれらに適切に名前を付けなかったという間違いを犯しました。

両方の名前を変更したいのですが、アセンブリを変更することで、2 番目のプロジェクトの名前/dll 名を変更できます。しかし、最初のアセンブリを変更すると、機能しません。コンパイルが失敗します。両方のexe名/元のファイル名を変更するにはどうすればよいですか?

ActionLog は私の最初の GUI プロジェクトです。名前を ActionLog1 に変更しようとしています。只今テスト中。xml で定義された GUI。

    ------ Build started: Project: ActionLog, Configuration: Debug x86 ------
C:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml.cs(24,13): error CS0103: The name 'InitializeComponent' does not exist in the current context
C:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml.cs(26,18): error CS1061: 'ActionLog.MainWindow' does not contain a definition for 'SearchBox' and no extension method 'SearchBox' accepting a first argument of type 'ActionLog.MainWindow' could be found (are you missing a using directive or an assembly reference?)
C:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml.cs(27,18): error CS1061: 'ActionLog.MainWindow' does not contain a definition for 'AllContacts' and no extension method 'AllContacts' accepting a first argument of type 'ActionLog.MainWindow' could be found (are you missing a using directive or an assembly reference?)
C:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml.cs(74,91): error CS1061: 'ActionLog.MainWindow' does not contain a definition for 'SearchBox' and no extension method 'SearchBox' accepting a first argument of type 'ActionLog.MainWindow' could be found (are you missing a using directive or an assembly reference?)
C:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml.cs(89,13): error CS0103: The name 'ContactsList' does not exist in the current context
C:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml.cs(97,17): error CS0103: The name 'ContactsList' does not exist in the current context
C:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml.cs(121,13): error CS0103: The name 'ButtonClose' does not exist in the current context
C:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml.cs(126,13): error CS0103: The name 'ButtonClose' does not exist in the current context
c:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml(240,134): error CS1061: 'ActionLog1.MainWindow' does not contain a definition for 'Grid_MouseLeftButtonDown' and no extension method 'Grid_MouseLeftButtonDown' accepting a first argument of type 'ActionLog1.MainWindow' could be found (are you missing a using directive or an assembly reference?)
c:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml(241,134): error CS1061: 'ActionLog1.MainWindow' does not contain a definition for 'Grid_MouseLeftButtonDown' and no extension method 'Grid_MouseLeftButtonDown' accepting a first argument of type 'ActionLog1.MainWindow' could be found (are you missing a using directive or an assembly reference?)
c:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml(242,107): error CS1061: 'ActionLog1.MainWindow' does not contain a definition for 'ButtonClose_MouseLeftButtonDown' and no extension method 'ButtonClose_MouseLeftButtonDown' accepting a first argument of type 'ActionLog1.MainWindow' could be found (are you missing a using directive or an assembly reference?)
c:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml(242,92): error CS1061: 'ActionLog1.MainWindow' does not contain a definition for 'ButtonClose_MouseEnter' and no extension method 'ButtonClose_MouseEnter' accepting a first argument of type 'ActionLog1.MainWindow' could be found (are you missing a using directive or an assembly reference?)
c:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml(242,92): error CS1061: 'ActionLog1.MainWindow' does not contain a definition for 'ButtonClose_MouseLeave' and no extension method 'ButtonClose_MouseLeave' accepting a first argument of type 'ActionLog1.MainWindow' could be found (are you missing a using directive or an assembly reference?)
c:\Users\admin\Proj\project-7440\ActionLog\MainWindow.xaml(244,131): error CS1061: 'ActionLog1.MainWindow' does not contain a definition for 'Grid_MouseLeftButtonDown' and no extension method 'Grid_MouseLeftButtonDown' accepting a first argument of type 'ActionLog1.MainWindow' could be found (are you missing a using directive or an assembly reference?)

Compile complete -- 14 errors, 0 warnings
4

1 に答える 1

0

あなたの状況を正確に理解しているかどうかはわかりませんが、従うべき戦略は次のとおりです。

ただし、開始する前に、必ずソリューション全体をバックアップしてください。(または、バージョン管理を使用することをお勧めします。)

最初に依存プロジェクトに取り組みます。

  1. プロジェクトの名前を変更します。
  2. プロパティ/アプリケーションに移動し、「アセンブリ名」と「デフォルト名前空間」の名前をプロジェクト名と一致するように変更します。
  3. プロジェクト全体の検索/置換を実行し、元の名前空間のすべてのインスタンスを新しい名前空間に置き換えます (安全のために、「単語全体のみ」と「大文字と小文字を一致させる」を使用してください)。
  4. コンパイル。

次に、GUI プロジェクトに取り組みます。

  1. References フォルダーで元の依存プロジェクトへの参照を見つけて削除します。
  2. プロジェクトの名前を変更します。
  3. プロパティ/アプリケーションに移動し、「アセンブリ名」と「デフォルト名前空間」の名前をプロジェクト名と一致するように変更します。
  4. References フォルダーを右クリックし、名前を変更した依存プロジェクトへの参照を再度追加します。
  5. プロジェクト全体に対して 2 つの検索/置換操作を実行します。

    • 1 つ目は、依存プロジェクトの名前空間を新しい名前空間に置き換える必要があります。

    • 2 つ目は、GUI プロジェクトの名前空間を新しい名前空間に置き換える必要があります。

  6. コンパイル。
于 2012-07-25T22:34:34.343 に答える