Error while trying to create a android native binding (implementing interface) - c#

So i'm trying to build a c# binding from a Android AAR, and i was following this guide https://developer.xamarin.com/guides/android/advanced_topics/binding-a-java-library/binding-an-aar/
But i'm running into an error like this
Severity Code Description Project File Line Suppression State
Error CS0534 'VaultManagerPaymentMethodsAdapter' does not implement inherited abstract member 'RecyclerView.Adapter.OnBindViewHolder(RecyclerView.ViewHolder, int)' Braintree.DropIn Path\Braintree.DropIn\obj\Release\generated\src\Com.Braintreepayments.Api.Dropin.Adapters.VaultManagerPaymentMethodsAdapter.cs 9 Active
And
Severity Code Description Project File Line Suppression State
Error CS0534 'VaultManagerPaymentMethodsAdapter' does not implement inherited abstract member 'RecyclerView.Adapter.OnCreateViewHolder(ViewGroup, int)' Braintree.DropIn Path\Braintree.DropIn\obj\Release\generated\src\Com.Braintreepayments.Api.Dropin.Adapters.VaultManagerPaymentMethodsAdapter.cs 9 Active
But if i try to add things to MetaData, i get errors saying that its already defined
<add-node path="/api/package[#name='com.braintreepayments.api.dropin.adapters']/class[#name='VaultManagerPaymentMethodsAdapter']">
<method abstract="false"
deprecated="not deprecated"
final="false"
name="onBindViewHolder"
native="false"
return="void"
static="false"
synchronized="false"
visibility="public">
<parameter name="holder"
type="android.support.v7.widget.RecyclerView.ViewHolder">
</parameter>
<parameter name="position"
type="int">
</parameter>
</method>
</add-node>
<add-node path="/api/package[#name='com.braintreepayments.api.dropin.adapters']/class[#name='VaultManagerPaymentMethodsAdapter']">
<method abstract="false"
deprecated="not deprecated"
final="false"
name="onCreateViewHolder"
native="false"
return="android.support.v7.widget.RecyclerView.ViewHolder"
static="false"
synchronized="false"
visibility="public">
<parameter name="parent"
type="android.view.ViewGroup">
</parameter>
<parameter name="viewType"
type="int">
</parameter>
</method>
</add-node>
any inputs would be appreciated

The temporary solution to this was to remove the node , not the ideal solution but since i don't need that specific thing, i just removed it

Related

Get Errors when adding a Service Reference to a project

I have built a Visual Studio project to consume a a 3rd party web service. The goal is to export CSV data. This is my first time consuming a web service so not sure what I am doing.
Here is the information that the web service has provided me (some info changed to protect my data):
Web Services Page, WSDL, and DataSource for Web Services Export:
https://reportservices.credtest.com/reports/ExportService.asmx
Encrypted Connection String:
GG3FakeStringgvwkdR4aCjKiu591-aUB2cfN18cYlNyqcpLD0V291y1gnZawA__
Query for Dataset Export:
<Query>
<SoapAction>
https://reportservices.credtest.com/ExportDataSet
</SoapAction>
<Method Namespace="https://reportservices.credtest.com/" Name="ExportDataSet">
<Parameters>
<Parameter Name="connection" Type="String">
<DefaultValue>
GG3FakeStringgvwkdR4aCjKiu591-aUB2cfN18cYlNyqcpLD0V291y1gnZawA__
</DefaultValue>
</Parameter>
<Parameter Name="start_date" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="end_date" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param1" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param2" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param3" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="true">
ExportDataSetResponse{}/ExportDataSetResult{}/diffgram{}/NewDataSet{}/Table{CPT_Code,Description,Other_Code,CPT_Modifier,Service_ID,Service,Service_Description,Program_ID,Program,Pgm_Dsc,Start_Minutes,End_Minutes,Matrix_ID,Start_Age,End_Age,Claim_Format,Credential_Group,RollUp_Code,Rate,Deaf_Rate,Fixed_Units,First_Unit_Minutes,Unit_Minutes,Unit_Multiplier}
</ElementPath>
</Query>
Query for XML Export:
<Query>
<SoapAction>
https://reportservices.credtest.com/ExportXML
</SoapAction>
<Method Namespace="https://reportservices.credtest.com/" Name="ExportXML">
<Parameters>
<Parameter Name="connection" Type="String">
<DefaultValue>
GG3FakeStringgvwkdR4aCjKiu591-aUB2cfN18cYlNyqcpLD0V291y1gnZawA__
</DefaultValue>
</Parameter>
<Parameter Name="start_date" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="end_date" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param1" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param2" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
<Parameter Name="custom_param3" Type="String">
<DefaultValue>
</DefaultValue>
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="true">
ExportXMLResponse{}/ExportXMLResult{}/diffgram{}/NewDataSet{}/Table{CPT_Code,Description,Other_Code,CPT_Modifier,Service_ID,Service,Service_Description,Program_ID,Program,Pgm_Dsc,Start_Minutes,End_Minutes,Matrix_ID,Start_Age,End_Age,Claim_Format,Credential_Group,RollUp_Code,Rate,Deaf_Rate,Fixed_Units,First_Unit_Minutes,Unit_Minutes,Unit_Multiplier}
</ElementPath>
</Query>
Here is the description of what is happening.
Every time I try to add a Connected service I get an error, either when adding the service (WCF) or when doing a build (gRPC or OpenAPI).
I go to Connected Services > Manage Connected Services
This opens the Service References (OpenAPI, gRPC, WCF Web Service) window.
I click on “Add a new service reference”. This opens the Add Service Reference window and shows 3 choices to pick from (OpenAPI, gRPC, WCF Web Service).
I have tried both OpenAPI and gRPC and get errors when doing a build.
WCF gives me an error during the
If I choose Open API then the “Add a new OpenAPI service reference” window opens.
I fill out the form with the following information:
URL: https://reportservices.credtest.com/reports/ExportService.asmx (link changed to protect my data)
Namespace: CredNS
Class Name: CredCN
Code Generation Language: C#
Severity : Error
Code: MSB3073
Description: The command ""C:\Users\dwoodard.nuget\packages\nswag.msbuild\13.0.5\build../tools/Win/NSwag.exe" openapi2csclient /className:CredCN /namespace:CredNS /input:C:\Users\dwoodard\source\repos\CredibleCoreWebApp\CredibleCoreWebApp\OpenAPIs\ExportService2.asmx /output:obj\ExportService2Client.cs " exited with code -1
Project CredibleCoreWebApp
File: C:\Users\dwoodard.nuget\packages\nswag.apidescription.client\13.0.5\build\NSwag.ApiDescription.Client.targets
Line 28
Column 5
Suppression State
If I choose gRPC then the “Add a new gRPC service reference” window opens.
I fill out the form with the following information:
URL: https://reportservices.credtest.com/reports/ExportService.asmx
Select the type of class to be generated: Client (I have also tried server and “Client and Server”)
I get the result “Successfully added service Reference(s)”.
If I click on “view generated code” then I get the following error:
Unable to get the generated codefiles for gRPC service reference ExportService2. You may need to build the project first.
I immediately do a build and get 82 errors.
Error #1:
Severity : Error
Code:
Description: \src\github\grpc\workspace_protoc_windows_x64\third_party\protobuf\src\google\protobuf\compiler\parser.cc:648] No syntax specified for the proto file: Protos/ExportService2.asmx. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
Project: CredibleCoreWebApp
File: C:\Users\dwoodard\source\repos\CredibleCoreWebApp\CredibleCoreWebApp[libprotobuf WARNING T
Line: 1
Column: 1
Suppression State:
The many errors following are like this:
Expected top-level statement (e.g. "message").
Need space between number and identifier.
"e" must be followed by exponent.
WCF Gives errors when trying to add so never succeeds.
I enter the URI: https://reportservices.credtest.com/reports/ExportService.asmx
Click GO
Services: reports/ExportService.asmx (automatically populated)
Status: Warning: One or more errors occurred.
Error Details:
Cannot import wsdl:port\r\nDetail: \r\nXPath to Error Source: //wsdl:definitions[#targetNamespace='https://www.credtest.com/']/wsdl:service[#name='ExportService']/wsdl:port[#name='ExportServiceHttpPost']
Cannot import wsdl:binding\r\nDetail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled.\r\nXPath to Error Source: //wsdl:definitions[#targetNamespace='https://www.credtest.com/']/wsdl:binding[#name='ExportServiceHttpPost']
Cannot import wsdl:port\r\nDetail: \r\nXPath to Error Source: //wsdl:definitions[#targetNamespace='https://www.credtest.com/']/wsdl:service[#name='ExportService']/wsdl:port[#name='ExportServiceHttpGet']
Cannot import wsdl:binding\r\nDetail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled.\r\nXPath to Error Source: //wsdl:definitions[#targetNamespace='https://www.credtest.com/']/wsdl:binding[#name='ExportServiceHttpGet']

Entity Framework 6 does not recognize mapped function in database model

I have a problem with Entity Developer and model defined function. Ealier I was mapping functions as a stored procedures because Entity Developer has no support for database functions as it goes. I was using solution mentioned in this topic from devart forum. But it has no use for me now, because I can't use it in Linq query as a part of bigger select statement on entity.
I am trying to add function like this and make it the way it is mentioned here. But i am getting this exception
Additional information: LINQ to Entities does not recognize the method 'System.Nullable1[System.Int32] EwBlobIleWyst(System.String, System.Nullable1[System.Int32], System.String, System.Nullable`1[System.Int32])' method, and this method cannot be translated into a store expression.
In ssdl file function is generated like this:
<Function Name="EW_BLOB_ILE_WYST" IsComposable="true" ReturnType="decimal" BuiltIn="false" Aggregate="false" NiladicFunction="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="EWID4" StoreFunctionName="EW_BLOB_ILE_WYST">
<Parameter Name="OWNER" Type="VARCHAR2" Mode="In" />
<Parameter Name="OWNER_ID" Type="decimal" Mode="In" />
<Parameter Name="RODZ_DOK_IDS" Type="VARCHAR2" Mode="In" />
<Parameter Name="LICZ_PUSTE" Type="decimal" Mode="In" />
In csdl file it is like this :
<Function Name="EwBlobIleWyst" ReturnType="Collection(Int32)" ed:Guid="f544518f-1cdd-484c-92b4-73b61491dc54">
<Parameter Name="OWNER" Type="String" />
<Parameter Name="OWNER_ID" Type="Int32" />
<Parameter Name="RODZ_DOK_DS" Type="String" />
<Parameter Name="LICZ_PUSTE" Type="Int32" />
<DefiningExpression>SELECT EWID4.EW_BLOB_ILE_WYST(:OWNER, :OWNER_ID, :RODZ_DOK_IDS, :LICZ_PUSTE) FROM KDOK_WSK</DefiningExpression>
And my implementation looks like this :
[EdmFunction(#"Ewid4", #"EwBlobIleWyst")]
public virtual global::System.Nullable<int> EwBlobIleWyst(string OWNER, global::System.Nullable<int> OWNER_ID, string RODZ_DOK_IDS, global::System.Nullable<int> LICZ_PUSTE)
{
throw new NotSupportedException();
}
This code is inside partial context class.
And I am using it in this way :
DokPow = ((Ewid4)context).EwBlobIleWyst("smth", 1, null, 0)
This snippet is inside select of queryable using Linq
I just get a solution. The problem was in attribute, database namespace generated by Entity Developer and function and variables types.
I had to make something like that:
[DbFunction("Ewid.Database.Entities.Store", "EW_BLOB_ILE_WYST")]
public static decimal EwBlobIleWyst(string OWNER, decimal OWNER_ID, string RODZ_DOK_IDS, decimal LICZ_PUSTE)
{
throw new NotSupportedException();
}
And change types to types that was genereted in ssdl file, csdl file does not matter and there is no need in adding function in Entity Developer to model, just leave it in ssdl file and map this function by hand in c# and it works like a charm.

Is it possible to filter nuget packages by supported platform?

For example, if I want only packages for .Net Platform Standard. Now I am looking for a package, try to install it, getting:
error: Package <name> is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0).
Package <name> supports: portable-win81+wpa81 (.NETPortable,Version=v0.0,Profile=Profile32)
error: One or more packages are incompatible with .NETCoreApp,Version=v1.0.
and I have to start again. I see the supported platforms. That means, the info is there.
Edit: It will be better if I can set a filter in Visual Studio, but I do not see such, I have not seen it in nuget.org too. So the question is: Is there a way to get packages only for certain platform (that means filter by platform search for something). What I am interested in is .Net Platform Standard. I hope, you do not see something vague here.
Edit:
Here is the search api from nuget.org
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0">
<edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="2.0" m:MaxDataServiceVersion="2.0">
<Schema xmlns="http://schemas.microsoft.com/ado/2006/04/edm" Namespace="NuGetGallery.OData">
<EntityType Name="V2FeedPackage" m:HasStream="true">...</EntityType>
</Schema>
<Schema xmlns="http://schemas.microsoft.com/ado/2006/04/edm" Namespace="NuGetGallery">
<EntityContainer Name="V2FeedContext" m:IsDefaultEntityContainer="true">
<EntitySet Name="Packages" EntityType="NuGetGallery.OData.V2FeedPackage"/>
<FunctionImport Name="Search" ReturnType="Collection(NuGetGallery.OData.V2FeedPackage)" EntitySet="Packages">
<Parameter Name="searchTerm" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="targetFramework" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="includePrerelease" Type="Edm.Boolean" Nullable="false"/>
</FunctionImport>
<FunctionImport Name="FindPackagesById" ReturnType="Collection(NuGetGallery.OData.V2FeedPackage)" EntitySet="Packages">
<Parameter Name="id" Type="Edm.String" FixedLength="false" Unicode="false"/>
</FunctionImport>
<FunctionImport Name="GetUpdates" ReturnType="Collection(NuGetGallery.OData.V2FeedPackage)" EntitySet="Packages">
<Parameter Name="packageIds" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="versions" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="includePrerelease" Type="Edm.Boolean" Nullable="false"/>
<Parameter Name="includeAllVersions" Type="Edm.Boolean" Nullable="false"/>
<Parameter Name="targetFrameworks" Type="Edm.String" FixedLength="false" Unicode="false"/>
<Parameter Name="versionConstraints" Type="Edm.String" FixedLength="false" Unicode="false"/>
</FunctionImport>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
When I use Search function, the 'searchTerm' parameter works, but not the 'targetFramework' parameter.
Another Edit: VisualStudio NuGet HTTP request in Fiddler:
GET /api/v2/Search()?$filter=IsAbsoluteLatestVersion&searchTerm='mvv'&targetFramework='netcoreapp1.0'&includePrerelease=true&$skip=0&$top=26 HTTP/1.1
The target framework is set automatically from Visual Studio NuGet Package Manager. What actually does not work is the targetFramework parameter in the search api from NuGet
NuGet has option to target the framework as mentioned in here
There is an open feature request matching your scenario on github
I feel there might a possibility to attain your filtering using power shell console scripts as I came across this page. See the section "Getting the FrameworkName".

Conditionally execute NLog target statement

I have one Enum class given below
public enum ScanStatus
{
Success,
Failure,
Exception
}
From .cs file I have passing the value of Exception to Nlog.config file using code
GlobalDiagnosticsContext.Set("ExceptionStatus", Convert.ToString((int)ScanStatus.Exception));
In nlog.config, i have configured to log the message in database using below code.
<target name="database" xsi:type="Database" keepConnection="true"
dbProvider="System.Data.SqlClient"
connectionStringName="PaymentScan"
commandText="INSERT INTO [dbo].[LoggingTrace] (PaymentId, ExceptionStatus, TraceDetails) VALUES (#ItemId, #ExceptionStatus, #Message)">
<parameter name="#message" layout="${message}"/>
<parameter name="#ItemId" layout="${gdc:ItemId}"/>
<!-- custom field! -->
<parameter name="#ExceptionStatus" layout="${gdc:ExceptionStatus}"/>
<!-- custom field! -->
</target>
I want this target statement should execute only when any exception occurs in the code. To handle this, I have written the rules given below
<rules>
<logger name="*" minlevel="Info" writeTo="database">
<filters>
<when condition="equals('${gdc:ExceptionStatus}', '2')" action="Log" />
</filters>
</logger></rules>
I am facing issue that When exception does not occurs, the target is getting executed, means equals statement written in rules in not working.
Could any body let me know the solution for this.

MsDeploy - Can't update Application Pool

I've been browsing dozens of sites to help me deploy a web service to an IIS using MsDeploy.
I need to create the application, modify application pool and enable protocols, and update a appSetting (that contains a connection string, don't ask me why).
I can do all of these, except applying the good Application pool.
Here's the parameters.xml file I added to the project :
<parameters>
<parameter tags="IisApp" defaultValue="Default Web Site/MyWebService" name="IIS Web Application Name">
<parameterEntry match="#defaultValue" scope="IisApp" kind="ProviderPath"/>
<parameterEntry match="#defaultValue" scope="setAcl" kind="ProviderPath"/>
</parameter>
<parameter name="Configuration Connection String" defaultValue="Some real Connection String in there" tags="">
<parameterEntry kind="XmlFile" scope="\\web.config$" match="/configuration/appSettings/add[#key='ConfigurationSQLConnectionString']/#value" />
</parameter>
<parameter name="Application Pool" defaultValue="MyOwnAppPool" description="Application pool for this site">
<parameterEntry kind="DeploymentObjectAttribute" scope="application" match="/application/#applicationPool" />
</parameter>
</parameters>
Here's the way I generate the package :
MsBuild MyWebService.csproj /T:Package /P:PackageLocation="c:\somewhere\package.zip" /P:IncludeAppPool=true /P:IncludeIisSettings=true
Here's the generated archive.xml file :
<sitemanifest MSDeploy.ObjectResolver.dirPath="Microsoft.Web.Deployment.DirPathObjectResolver" MSDeploy.ObjectResolver.filePath="Microsoft.Web.Deployment.FilePathObjectResolver">
<appHostConfig path="Default Web Site/MyWebService" MSDeploy.path="2" MSDeploy.MSDeployLinkName="Child1" MSDeploy.MSDeployKeyAttributeName="path" MSDeploy.MSDeployProviderOptions="some stuff">
<application path="/MyWebService" MSDeploy.path="2" applicationPool="DefaultAppPool" MSDeploy.applicationPool="1" enabledProtocols="http" MSDeploy.enabledProtocols="1" serviceAutoStartEnabled="false" MSDeploy.serviceAutoStartEnabled="1" serviceAutoStartProvider="" MSDeploy.serviceAutoStartProvider="1" MSDeploy.MSDeployLinkName="PathElement" MSDeploy.MSDeployKeyAttributeName="path">
<virtualDirectoryDefaults path="" MSDeploy.path="1" physicalPath="" MSDeploy.physicalPath="9" userName="" MSDeploy.userName="1" password="" MSDeploy.password="1" logonMethod="ClearText" MSDeploy.logonMethod="1" allowSubDirConfig="true" MSDeploy.allowSubDirConfig="1" MSDeploy.MSDeployLinkName="virtualDirectoryDefaults" />
<virtualDirectory path="/" MSDeploy.path="2" physicalPath="C:\somewhere\MyWebService" MSDeploy.physicalPath="8" userName="" MSDeploy.userName="1" password="" MSDeploy.password="1" logonMethod="ClearText" MSDeploy.logonMethod="1" allowSubDirConfig="true" MSDeploy.allowSubDirConfig="1" MSDeploy.MSDeployKeyAttributeName="path" />
</application>
</appHostConfig>
<contentPath path="C:\somewhere\MyWebService\obj\Debug\Package\PackageTmp" MSDeploy.path="2" MSDeploy.MSDeployLinkName="Child2" MSDeploy.MSDeployKeyAttributeName="path" MSDeploy.MSDeployProviderOptions="some other stuff">
<MSDeploy.dirPath path="C:\somewhere\MyWebSerivce\obj\Debug\Package\PackageTmp" MSDeploy.MSDeployLinkName="contentPath" />
</contentPath>
<setAcl path="C:\somewhere\MyWebService\obj\Debug\Package\PackageTmp" MSDeploy.path="2" isDest="AA==" MSDeploy.isDest.Type="Microsoft.Web.Deployment.DeploymentObjectBooleanAttributeValue" setAclUser="" MSDeploy.setAclUser="1" setAclAccess="Read" MSDeploy.setAclAccess="1" MSDeploy.MSDeployLinkName="Child3" MSDeploy.MSDeployKeyAttributeName="path" MSDeploy.MSDeployProviderOptions="still some stuff" />
<setAcl path="C:\somewhere\MyWebService\obj\Debug\Package\PackageTmp" MSDeploy.path="2" isDest="AA==" MSDeploy.isDest.Type="Microsoft.Web.Deployment.DeploymentObjectBooleanAttributeValue" setAclUser="anonymousAuthenticationUser" MSDeploy.setAclUser="1" setAclAccess="Read" MSDeploy.setAclAccess="1" MSDeploy.MSDeployLinkName="Child4" MSDeploy.MSDeployKeyAttributeName="path" MSDeploy.MSDeployProviderOptions="final stuff I guess" />
</sitemanifest>
Here's the generated parameters.xml :
<parameters>
<parameter name="IIS Web Application Name" defaultValue="Default Web Site/MyWebService" tags="IisApp">
<parameterEntry kind="ProviderPath" scope="AppHostConfig" match="^Default\ Web\ Site/MyWebService$" />
<parameterEntry kind="ProviderPath" scope="contentPath" match="^C:\\somewhere\\MyWebService\\obj\\Debug\\Package\\PackageTmp$" />
<parameterEntry kind="ProviderPath" scope="setAcl" match="^C:\\somewhere\\MyWebService\\obj\\Debug\\Package\\PackageTmp$" />
<parameterEntry kind="ProviderPath" scope="IisApp" match="#defaultValue" />
<parameterEntry kind="ProviderPath" scope="setAcl" match="#defaultValue" />
</parameter>
<parameter name="IIS Web Application Pool Name" defaultValue="DefaultAppPool">
<parameterEntry kind="DeploymentObjectAttribute" scope="application" match="application[#applicationPool='DefaultAppPool']/#applicationPool" />
</parameter>
<parameter name="IisVirtualDirectoryPhysicalPath" defaultValue="C:\somewhere\MyWebService" tags="PhysicalPath">
<parameterEntry kind="DestinationVirtualDirectory" scope=".*" match="^C:\\somewhere\\MyWebService$" />
</parameter>
<parameter name="Configuration Connection String" defaultValue="Some real Connection String in there">
<parameterEntry kind="XmlFile" scope="\\web.config$" match="/configuration/appSettings/add[#key='ConfigurationSQLConnectionString']/#value" />
</parameter>
<parameter name="Application Pool" description="Application pool for this site" defaultValue="MyOwnAppPool">
<parameterEntry kind="DeploymentObjectAttribute" scope="application" match="/application/#applicationPool" />
</parameter>
</parameters>
And finally, here's the command I launch to deploy the package :
msdeploy.exe -verb:sync -allowUntrusted -enableLink:AppPoolExtension -source:package="c:\somewhere\Package.zip" -dest:auto,computerName="https://destinationserver:8172/MsDeploy.axd?site=WebSite_Deployment",userName="destinationserver\deploymentUser",password="shouldKeepItSecret",authType="basic" -setParam:name="IIS Web Application Name",value="WebSite_Deployment/MyWebService" -setParam:name="Configuration Connection String",value="The Real Connection String" -setParam:name="Application Pool",value="FinalAppPool" -setParam:name="IIS Web Application Pool Name",value="FinalAppPool" -verbose
I get the following log :
Verbose: Parameter entry 'IIS Web Application Pool Name/1' is applicable to 'sitemanifest/appHostConfig[#path='Default Web Site/MyWebService']/application[#path='/MyWebService']' because of its scope.
Verbose: Parameter entry 'Application Pool/1' is applicable to 'sitemanifest/appHostConfig[#path='Default Web Site/MyWebService']/application[#path='/MyWebService']' because of its scope.
But finally, the application pool that is set DefaultAppPool (and not FinalAppPool as expected). I first thought that msdeploy took the default application pool value for the parameter "IIS Web Application Pool Name". but it always take DefaultAppPool.
I just don't understand why.
As you can see, I'm using basic authentication with a non administrator account. I've activated Management Delegation Service on destinationServer to delegate contentPath, iisApp and setAcl to current user, and createApp and appHostConfig to WDeployConfigWriter.
The fact that I added the parameter "Application Pool" is because I found this here.
But even if I keep only one of those two parameters (Application Pool and IIS Web Application Pool Name"), the 2nd one is always in the archive.xml because of the msbuild package parameter IncludeIisSettings=true. And the result is the same.
It doesn't seem to be a right issue, as long as the application pool is really set by msdeploy. It's just that it doesn't take the provided application pool.
We also have a similar problem for Enable Protocols.
Sorry for the length, but I wanted to be exhaustive.
Don't know how you're deploying, but maybe you can use a script (with postSync argument) as mentionned there:
.net WebDeploy is there any way to run command/script on the target machine after deploy
In this script you can do everything you want with appcmd:
https://learn.microsoft.com/en-us/iis/get-started/getting-started-with-iis/getting-started-with-appcmdexe

Categories