locked
The operation could not be completed. The parameter is incorrect RRS feed

  • Question

  • User1453549677 posted

    I'm getting "The operation could not be completed. The parameter is incorrect" when I build the solution. I tried deleting the .suo file as suggested in another thread

    but that didn't work.

    Can anyone help? Thanks.

    +++++++++++++++++++++++++++++ IService1.cs ++++++++++++++++++++++

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.ServiceModel.Web;
    using System.Text;

    namespace WcfService2
    {
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService1
    {

    [OperationContract]
    [WebInvoke(Method = "GET", UriTemplate = "/SayHello/{Name}", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
    string SayHello(string Name);
    }
    }

    +++++++++++++++++++++++++++++++++++ Service1.svc.cs ++++++++++++++++++++++++++++++++++++++++++

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.ServiceModel.Web;
    using System.Text;

    namespace WcfService2
    {
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging.
    public class Service1 : IService1
    {
    public string SayHello(string name)
    {
    return string.Format("Hello, {0}", name);
    }
    }
    }

    +++++++++++++++++++++++++++++++ web.config +++++++++++++++++++++++++++++++++++++++++++++++++++

    <?xml version="1.0"?>
    <configuration>

    <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
    </appSettings>
    <system.web>
    <compilation debug="true" targetFramework="4.6"/>
    <httpRuntime targetFramework="4.6"/>
    <!--<httpModules>
    <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
    </httpModules>-->
    </system.web>
    <system.serviceModel>
    <behaviors>
    <endpointBehaviors>
    <behavior name="web">
    <webHttp helpEnabled="true" />
    </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
    <behavior name="ServiceBehavior">
    <serviceMetadata httpGetEnabled="true" />
    <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
    </serviceBehaviors>
    </behaviors>
    <services>
    <service name="WcfService2.Service1" behaviorConfiguration="ServiceBehavior">

    <endpoint binding="webHttpBinding" contract="WcfService2.IService1" behaviorConfiguration="web">


    </endpoint>
    </service>

    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
    </system.serviceModel>
    <!--<protocolMapping>
    <add binding="basicHttpsBinding" scheme="https"/>
    </protocolMapping>-->
    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
    <!--<remove name="ApplicationInsightsWebTracking"/>
    <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
    preCondition="managedHandler"/>
    </modules>
    -->
    <!--
    To browse web app root directory during debugging, set the value below to true.
    Set to false before deployment to avoid disclosing web app folder information.
    -->
    <!--
    <directoryBrowse enabled="true"/>
    <validation validateIntegratedModeConfiguration="false"/>-->


    </configuration>

    Saturday, February 10, 2018 5:09 PM

Answers

  • User475983607 posted

    Open Visual Studio as an admin.  Right click the VS shortcut and select "Run as administrator".

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 10, 2018 5:12 PM

All replies

  • User475983607 posted

    Open Visual Studio as an admin.  Right click the VS shortcut and select "Run as administrator".

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 10, 2018 5:12 PM
  • User1168443798 posted

    Hi drl,

    I created a new WCF Service, and replace IService1.cs, Service1.svc and web.config, but it builds correctly.

    Could you share us your solution, and then we could try to reproduce your issue?

    Best Regards,

    Edward

    Monday, February 12, 2018 3:54 AM