简体   繁体   English

WCF服务库项目找不到对其他项目的引用

[英]WCF service library project can't find reference to other project

I have two projects in my solution: MyApp.Domain and MyApp.WebService. 我的解决方案中有两个项目:MyApp.Domain和MyApp.WebService。 MyApp.WebService is a WCF service library. MyApp.WebService是一个WCF服务库。

I want to use some utility functions from MyApp.Domain. 我想使用MyApp.Domain中的一些实用程序函数。 So in MyApp.WebService, I added a reference to MyApp.Domain. 所以在MyApp.WebService中,我添加了对MyApp.Domain的引用。

Intellisense picked it up just fine, it recognized the function I need to call. 智能感知它很好,它识别了我需要调用的功能。 But when I build the solution, I get this error: 但是当我构建解决方案时,我收到此错误:

The type or namespace name 'Domain' does not exist in the namespace 'MyApp' (are you missing an assembly reference?) 命名空间“MyApp”中不存在类型或命名空间名称“Domain”(您是否缺少程序集引用?)

at using MyApp.Domain.Utility; using MyApp.Domain.Utility;

What's going wrong here? 这里出了什么问题?

Make sure both are using the same profile... if one is using the client profile you could be getting this error.... also if the referenced assembly has some references in it to other assemblies you may need to include them in the project as well. 确保两者都使用相同的配置文件...如果使用客户端配置文件,您可能会收到此错误....如果引用的程序集中有一些引用到其他程序集,您可能需要将它们包含在项目中同样。 If that doesn't get it make sure both have the same setting for 32 vs 64 bit... 如果没有得到它,请确保两者都具有相同的设置32对64位...

GL GL

Remove WCF Service project from Solution and build solution. 从解决方案和构建解决方案中删除WCF服务项目。 After building solution, add WCF project again. 构建解决方案后,再次添加WCF项目。 Issue will be resolved. 问题将得到解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用netTcpBinding将WCF服务引用添加到客户端项目 - Can't add WCF service reference to client project using netTcpBinding 从客户端使用WCF服务,而没有WCF服务库项目/程序集参考 - Consume WCF service from client without WCF Service Library project/assembly reference 无法将Azure VM上托管的WCF服务引用添加到VS2015项目 - Can't add WCF service reference hosted on Azure VM to VS2015 project Visual Studio 2019 16.11 - 无法在 netstandard 2.1 项目中更新或创建 WCF 服务引用 - Visual Studio 2019 16.11 - Can't update nor create WCF service reference in netstandard 2.1 project 无法在同一解决方案中为WCF项目的客户端类添加服务引用 - Can't add service reference to client class for WCF project within same solution WCF服务参考和对同一项目的参考 - WCF Service Reference and Reference to same project 我无法将WCF参考添加到Windows Mobile项目吗? - I can't add WCF reference to windows mobile project? 在Silverlight项目中更新WCF服务参考时出错 - Error updating WCF service reference in silverlight project 如何将.exe项目引用到WCF服务? - How to reference a .exe project to WCF Service? 在WCF服务库项目中使用自定义ServiceHostFactory - Using a custom ServiceHostFactory in a WCF Service Library project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM