从WSP转换为WAP时,为什么VS不会自引用项目的核心DLL?
我正在尝试将网站项目转换为 Web 应用程序项目。我到处都进行了 RTFM,并浏览了所有演练,但 Visual Studio 只是对某些事情很固执——
它似乎没有引用自己的程序集——它将在以下情况下创建的程序集:它建立了。当我尝试构建时,它会抛出一个错误,因为项目本身的 CS 文件中包含的代码缺少命名空间——将编译为项目核心 DLL 的代码。
这是先有鸡还是先有蛋的问题——VS 希望在构建之前引用该 DLL,但它需要构建才能获取 DLL。
为了进行转换,我创建了一个新的 Web 应用程序项目,导入所有文件,并对所有 ASPX 文件和项目文件本身执行“转换为 Web 应用程序...”。
尽管如此,VS 仍然确信它没有构建所需的代码,并且拒绝承认该代码位于项目本身的源代码中。
I'm trying to convert a Web Site Project to a Web Application Project. I've RTFM'd all over the place, and looked through all the walkthroughs, but Visual Studio is just being obstinate about something --
It doesn't seem to have a reference to its own assembly -- the assembly it will create when it builds. When I try to build, it throws an error for missing namespaces for code contained in CS files in the project itself -- code that would compile up to the core DLL of the project.
It's a chicken/egg problem -- VS wants that DLL to reference before it will build, but it needs to build to get the DLL.
To convert, I create a new web app project, imported all the files, and did the "Convert to Web Application..." on all the ASPX files and on the project file itself.
Still, VS is convinced it doesn't have the code it needs to build, and refuses to acknowledge that the code is in the source of the project itself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了。我引入的所有 CS 文件都在“构建操作”下标记为“内容”。它们需要更改为“编译”。
Found it. All of the CS files I brought in were marked as "Content" under Build Action. They needed to be changed to "Compile."