Visual Studios 编译查询
我正忙于使用 MVVMish 设计模式在 C# 和 WPF 中构建应用程序。目前它由一个 dll 和一个 exe 组成。
我的问题是,为什么当我尝试编译程序时,它只有在平台设置为混合平台时才能成功运行?例如,如果我将其更改为“任何 CPU”,它会编译并运行,但不会拾取我在 dll 中所做的任何新更改,但当我将其设置为“混合平台”时,它会拾取这些更改。
另一件事是,当我最初处理该项目时,我可以在 x86 模式下调试它,但是当我尝试在 x86 中发布它时,它说找不到程序集,甚至是同一 exe 文件中的程序集。我确实注意到这似乎只发生在 wpf 中,在 windows 或 usercontrol 标记中我有 xmlns:View...etc 找不到视图?
只是想知道:D
I am busy building an application in C# and WPF, using an MVVMish design pattern. At the moment it consists of a dll and an exe.
My question is why when I try to compile the program it only successfully works when the platform is set to Mixed Platforms? For example if I change it to Any CPU it compiles and runs but doesn't pick up any new changes that I made in the dll, but when I set it to Mixed platform it picks up the changes.
Another thing is when I was working on the project initial, I could debug it in x86 mode, but when I tried to release it in x86 it says it couldn't find the assemblies, even the ones in the same exe file. I did notice that this only seemed to happen in wpf where in the windows or usercontrol tag where I had the xmlns:View...etc it couldn't find the view??
Just wondering :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果即使您正在进行更改,项目似乎也没有正在构建,或者即使您发出 build all,项目也没有构建,请按照以下步骤操作:
此问题是由 Visual Studio 将应用程序项目默认为“x86”并将库项目默认为“任何 CPU”的新习惯引起的。最终结果是,您的解决方案中立即会得到一大堆配置,其中一些配置未被选择构建。
基本上,您必须对要为您的解决方案平台构建哪种类型的项目平台进行排序或准确组合,并确保选择构建所有项目。
例如,这可能需要选择将“任何 CPU”库包含在“x86”解决方案配置中,并与“x86”应用程序一起构建。
If projects do not appear to be building even though you are making changes or projects do not get built even though you issue build all then follow these steps:
This problem is caused by Visual Studio's new habit of defaulting application projects to "x86" and library projects to "Any CPU". The net result is that you immediately get a hodgepodge of configurations in you solution, some of which are not selected to be built.
Basically you have to sort or exactly which combination of which type of project platform to be built for your solution platform and make sure that all projects are selected to be built.
For example, this may require selecting that the "Any CPU" library is to included and built along with the "x86" application in the "x86" solution configuration.