我在VS2010中有两个项目。第一个是依赖于具有DLL的第二个GUI。 我没有正确命名它们时犯了一个错误。
现在我想更改两者的名称,我可以通过更改程序集来更改第二个项目的名称/ 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
答案 0 :(得分:0)
我不确定我是否完全理解你的情况,但这是一个遵循的策略:
在开始之前,请确保备份整个解决方案! (或者更好的是,使用版本控制。)
首先处理您的依赖项目:
现在处理您的GUI项目:
为整个项目执行两次查找/替换操作:
第一个应该使用新命名空间替换依赖项目的命名空间。
第二个应该用新命名空间替换GUI项目的命名空间。