简体   繁体   中英

Cannot add WCF Service to Project Visual Studio 2017

I've created an empty ASP .NET Web Application and added an ADO .NET Entity Data Model which, at a later moment, I'd like to access via a WPF client. However whenever I'm trying to add an WCF Service to my project im greeted with the error:

object reference not set to an instance of an object.

Does someone have any solutions?

EDIT: I've deployed my project on the local IIS and when I try to navigate to my Service.svc the two tables that should be displayed are shown in a perfectly fine way, but when I navigate to one of them using this URL:

http://localhost/TestUE/Service1.svc/movie

I'm greeted with this error:

<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code/>
<m:message xml:lang="de-AT">Fehler beim Verarbeiten dieser Anforderung.</m:message>
</m:error>

Apparently a new Visual Studio 2017 update (15.5.5) fixed the issue I had with adding a new WCF Service, now it works again with no problems at all.

The second issue I had with not being able to navigate to one of my table names with the given URL has been resolved by also activating ASP.NET Impersonation in the authentication settings of the IIS virtual directory corresponding to my project. Then under Edit I chose the first available option and entered my user credentials.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM