我有一个包含webservices(.asmx)
的项目。
关键是当我将该项目从我的一台计算机复制到另一台计算机,然后编写一个函数时,发生的事情是它没有引发任何错误,但是没有向我展示我编写的新函数并显示了所有列表。复制之前声明的函数。WebMethod
代码如下:
[WebMethod]
public string test(string msg)
{
return msg;
}
在输出选项卡中构建或重建后,它显示:
1>------ Build started: Project: CabSoftService, Configuration: Debug Any CPU ------
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Postcode". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(2151,5): warning MSB3283: Cannot find wrapper assembly for type library "MSDATASRC". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit.
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(2151,5): warning MSB3293: Could not resolve dependent COM reference "7c0ffab0-cd84-11d0-949a-00a0c91110ed" version 1.0.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
最佳答案
创建webservice
后,您必须将其部署在IIS
中,之所以可能会丢失文件,可能是因为该项目可能尚未在第二个系统中进行部署。如果您采用的是同一项目,请始终重新构建并重新发布。
关于c# - 从一台PC复制到另一台PC后未显示WebService(.asmx)函数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30371141/