我已将 wcf 数据服务项目发布到 IIS7,并在该服务器上安装了 .NET 4。一切工作正常,但是当我从客户端调用 SaveChanges 时,服务返回错误:
Server Error in '/' Application.
Description: An error occurred while accessing the resources required to serve this request. You might not have permission to view the requested resources.
Error message 401.3: You do not have permission to view this directory or page using the credentials you supplied (access denied due to Access Control Lists). Ask the Web server's administrator to give you access.
尽管在我的本地 Visual Studio 主机服务器上一切正常。
包含网站的目录的权限似乎是正确的。无法识别问题所在。
服务配置:
config.UseVerboseErrors = true;
config.SetEntitySetAccessRule("*", EntitySetRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
最佳答案
将“经过身份验证的用户”添加到对 *.svc 文件具有写入权限的用户会有所帮助,但这只是一个糟糕的解决方案。也许有人可以建议更好的一个?
关于.net - WCF数据服务SaveChanges问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3458954/