简体   繁体   中英

After renaming the service1.svc file to someNameService.svc wcf service wont run

created a new wcf service project. Renamed the service1 both file to newName.svc and class name. Now when I run it, it says "cant find type namespace.service1" in Service attribute in configurationelement system.serviceModel/serviceHostingEnvironment/serviceActivations. No such attribute in web.config. So where is it and how do I change it?

From googling I found this: solution I have seen similar questions all specifying different versions of IIS it was realy just to open the svc file with Xml(Text)Editor using the right click Open With.. option from within visual studio. There is the Service attribute with the incorrect value. Feel free to up vote cause I could realy use the rep

According to the information you provide the fix would be something like this:

<system.serviceModel>
    <services>
      <service name="YourProject.Project.YourService" behaviorConfiguration="">
        <endpoint address ="" binding="" contract="YourProject.Project.IYourService" behaviorConfiguration="">
        </endpoint>
      </service>
    </services>

Where contract is your interface of the service you have, newName.svc

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