The element 'system.webServer' has invalid child element 'httpPlatform' - asp.net

I am working through Shawn Wildermuth's course here and get the following warning about web.config when I build
Severity Code Description Project File
Line
Warning The element 'system.webServer' has invalid child element 'httpPlatform'.
List of possible elements expected: 'asp, caching, cgi, defaultDocument,
directoryBrowse, globalModules, handlers, httpCompression, webSocket,
httpErrors, httpLogging, httpProtocol, httpRedirect, httpTracing,
isapiFilters, modules, applicationInitialization, odbcLogging, security,
serverRuntime, serverSideInclude, staticContent, tracing, urlCompression,
validation, management, rewrite'.
TheWorld E:\EShared\Pluralsight\aspdotnet-5-ef7-bootstrap-angular-web-app\1-aspdotnet-5-ef7-bootstrap-angular-web-app-m1-exercise-files\VS2015\src\TheWorld\wwwroot\web.config 8
Web.config is
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
The program runs ok. Should I be doing anything about the warning?

Up until the time the current is written (Jan-2016) this is a known issue that MS did not fix. It will probably be fixed in a later version/update.
The problem is that the httpPlatform element is missing from:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Xml\Schemas\1033\DotNetConfig.xsd
You can manualy modify the xsd with an editor having Administrator right and add this under the system.webServer:
<xs:element name="httpPlatform" vs:help="configuration/system.webServer/httpPlatform">
<xs:complexType>
<xs:attribute name="arguments" type="xs:string" use="optional" vs:help="configuration/system.webServer/httpPlatform/arguments" />
<xs:attribute name="processPath" type="xs:string" use="required" vs:help="configuration/system.webServer/httpPlatform/processPath" />
<xs:attribute name="startupTimeLimit" use="required" vs:help="configuration/system.webServer/httpPlatform/startupTimeLimit">
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minInclusive value="1" />
<xs:maxInclusive value="99999" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="stdoutLogEnabled" type="small_boolean_Type" use="required" vs:help="configuration/system.webServer/httpPlatform/stdoutLogEnabled" />
<xs:attribute name="stdoutLogFile" type="xs:string" vs:help="configuration/system.webServer/httpPlatform/stdoutLogFile" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict" />
</xs:complexType>
</xs:element>
This solved the problem for me.
UPDATE: you can find a similar post here. I got the original idea there, but modified the schema a bit.
UPDATE2: a hint to find the spot to add the element is to locate
<xs:element name="handlers" vs:help="configuration/system.webServer/handlers">
and place it just above it.

First, that course is rather old now (RC2 is coming), so you would have to give it up, and wait to see if a newer course is coming.
[Updated: For RC2 and above, a new module is required instead of HttpPlatformHandler, https://github.com/aspnet/Announcements/issues/164]

Related

BizTalk FF Disassembler - Only Working With Very Small Files

I have a BizTalk 2016 / VS 2015 Solution.
There's a simple flat file schema that debatches each row by having a repeating record element have its "Max Occurs" property set to 0.
The "config" part of the schema can be seen below:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
<b:schemaInfo standard="Flat File" codepage="65001" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="true" early_terminate_optional_fields="true" allow_message_breakup_of_infix_root="true" compile_parse_tables="false" root_reference="Employee" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Employee">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
<b:properties>
<b:property distinguished="true" xpath="/*[local-name()='Employee' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='Data' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='NiNumber' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']" />
<b:property distinguished="true" xpath="/*[local-name()='Employee' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='Data' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='OrgLeaveDate' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']" />
<b:property distinguished="true" xpath="/*[local-name()='Employee' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='Data' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='PosLeaveDate' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']" />
<b:property distinguished="true" xpath="/*[local-name()='Employee' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='Data' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']/*[local-name()='PostStartDate' and namespace-uri()='http://LCC.Integration.Employees.Schemas.SAP.SapEmployee_FF']" />
</b:properties>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element maxOccurs="1" name="Data">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0x9" child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
The input file is tab delimited with unix style line endings.
The only slightly unusual thing about the flat-file schema is that the last element "PostStartDate" has a micOccurs attribute value of 0. This is because there are a couple of providers of these document and one of the providers doesn't include a "PostStartDate" column.
I've setup a receive location that contains a FF disasembler. It has the DocumentSpecName property set to that of the schema. All other properties are as default.
The only subscriber to this receive is a send port that sends to a local folder.
If I drop a flat file with 3 rows then all works ok. However, if I extend with a few more rows (7 total in this example) then BizTalk suspends on the receive location with the error: "The Messaging Engine encountered an error during the processing of one or more inbound messages." In the event log, I see the error:
There was a failure executing the receive pipeline: "LCC.Integration.Common.Pipelines.RcvArchiveFF, LCC.Integration.Common.Pipelines, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ff3873c2d0a7e656" Source: "Flat file disassembler" Receive Port: "SharePoint.Employees.Receive.SAPExtract" URI: "D:\FileDrop\Employees\In\*.txt" Reason: Unexpected data found while looking for:
'\t'
The current definition being parsed is Employee. The stream offset where the error occured is 1813. The line number where the error occured is 8. The column where the error occured is 0.
Another thing I've noticed, if I remove the trailing LF from the last row in the file then it works - regardless of the number of rows.
I've made a screencast to demo the problem: Screencast of Problem
I've created a sample solution to demonstrate the problem. This is available at the following github repo: https://github.com/RobBowman/BizTalkFFProblem
Any ideas?
Edit: I just tried your GitHub Sample in BizTalk 2013R2 and it's working fine without the change.
Edit2: Broken when >20 rows.
Edit3: I now realize that it's not really supported, the setting is: 'Allow Message Breakup At Infix Root'... your schema is not infix, it's postfix. Debatching FlatFiles on the disassember is only supported when infix. If possible, you should make your schema to support infix, then it'll work.

Microsoft App Center add external package

How I do add packages sources in my project?
In my Visual Studio, i go to tools -> options -> Nuget Package Manager -> Package Sources.
And add the package information that in this case is not in Nuget. Now in the App Center I did not find this information and with this my project does not compile
You can create a NuGet.config file as described in the docs.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget" value="https://api.nuget.org/v2/index.json" />
<add key="MyGet" value="https://www.myget.org/F/MyUsername/api/v2/index.json" />
<add key="MyAuthNuget" value="https://nuget.example.com/v2/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSourceCredentials>
<MyAuthNuget>
<add key="Username" value="$USER_VARIABLE" />
<add key="ClearTextPassword" value="$PASSWORD_VARIABLE" />
</MyAuthNuget>
</packageSourceCredentials>
</configuration>
Maybe this will also help somebody. For me the above solution haven't worked. So what I've discovered - always check if official source of packages is same as in your config. For now nuget source have changed to version 3:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<activePackageSource>
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
</activePackageSource>
</configuration>

Biztalk 2013 WCF-webhttp (WCF web publishing wizard) not exposing schemas

Wonder if you guys can help. I have used the BizTalk WCF Service Publishing wizard to expose an Orchestration via WCF-WebHttp, and I can see the service and I am able to send requests to it via SOAPUi etc, however, I cannot see any of the schemas when I try and add the service reference to a .NET application. I've ensured that the schemas are in the same project, and that the actual DLL is GAC'd before deploying the service.
I've looked at the wsdl but I cannot see anything related to the schemas.
<wsdl:types>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Message" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/Message">
<xs:complexType name="MessageBody">
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="ITwoWayAsync_BizTalkSubmit_InputMessage">
<wsdl:part name="message" type="q1:MessageBody" xmlns:q1="http://schemas.microsoft.com/Message" />
</wsdl:message>
<wsdl:message name="ITwoWayAsync_BizTalkSubmit_OutputMessage">
<wsdl:part name="BizTalkSubmitResult" type="q2:MessageBody" xmlns:q2="http://schemas.microsoft.com/Message" />
</wsdl:message>
<wsdl:portType name="ITwoWayAsync">
<wsdl:operation name="BizTalkSubmit">
<wsdl:input wsaw:Action="BizTalkSubmit" message="tns:ITwoWayAsync_BizTalkSubmit_InputMessage" />
<wsdl:output wsaw:Action="http://www.microsoft.com/biztalk/2006/r2/wcf-adapter/ITwoWayAsync/BizTalkSubmitResponse" message="tns:ITwoWayAsync_BizTalkSubmit_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:service name="BizTalkServiceInstance" />
</wsdl:definitions>
When I try and add a service reference to the service, it successfully adds the reference, but for the method called BizTalkSubmit, it only takes a parameter of System.ServiceModel.Channels.Message.
Any ideas greatly appreciated.
Regards
Jazzyuk
I would recommend that you publish using WCF-WSHttp first, then changing to WCF-WebHttp afterwards. This will enable you to choose a schema to publish:

.NET Web Deployment Tool with log4Net: Not overwriting logs

I'm using the Web Deployment Tool to build and release an MVC site from VS 2010 to a server running IIS. I also have log4net logging to a subdirectory off of the root of the web application I'm deploying to. I already figured out how to keep write permissions intact when deploying with this tool on that directory, but now I'm running into the problem that I'd rather not lose the logs when deploying, and also, the deploy is failing because the log file that log4net is using is "used by another process" (presumably w3wp) and won't let the deploy continue.
So, I'd like to preserve the log files and not delete or overwrite them, for auditing purposes. Is there a way to do that within the confines of the Web Deployment Tool?
EDIT: Here's the applicable bits of the log4net configuration, in Web.Config.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" />
</configSections>
<log4net>
<appender name="RollingLog" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Logs\Log.txt" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Composite" />
<maxSizeRollBackups value="20" />
<maximumFileSize value="10MB" />
<datePattern value="yyyyMMdd" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="{%level}%date{MM/dd HH:mm:ss} - %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="RollingLog" />
</root>
</log4net>
</configuration>
Found it by hunting around: there is a "skip" parameter you can tack on to the command when you call the pre-packaged deploy script. You HAVE to use a regular old CMD prompt for this; Powershell's crazy escaping of quotes makes it near-impossible to get right, so I gave up. Anyway, here's the end result I came up with:
.\MyProject.deploy.cmd /Y /M:MyServerName "-skip:skipAction=Delete,objectName=filePath,absolutePath=Logs"
"MyProject.deploy.cmd" being the name of the prepackaged deploy command, "MyServerName" being the name of the server I was deploying to, and "Logs" being the name of the folder I wanted to skip. This command seems to leave alone that Logs directory and deploy anything else that matters.
Source where I started to hone in on things: http://blogs.iis.net/msdeploy/archive/2009/04/23/what-has-changed-about-skip-replace-rules-in-rc.aspx
Set locking model of your appender to minimal lock and everything will be fine:
<appender name="RollingLog" type="log4net.Appender.RollingFileAppender">
...
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
...
</appender>
log4net.Appender.FileAppender (see remarks)

How do you update FX_schema.xml file in IIS 7?

We are deploying our ASP.Net MVC application to a windows 2008 R2 server, running IIS 7.5.
After deployment, we get this error in the event log (we also get an email) :
"Unrecognized element 'providerOption'" on line x in c:\wwwroot\web.config
which is:
<providerOption name="CompilerVersion" value="v3.5">
located in the system.codedom compiliers section of our standard web config. I investigated the problem a bit. (I also checked the namespace details on msdn to find out abit about it). Amongst many other solutions, I found this post recommending updating the FX_Schema.xml file on our server. (I think this is where the problem is, please correct me if I'm mistaken)
I looked through fx_schema file, and, as defined in the event viewer, the attribute "providerOption" is not in this schema! Here is the copy of the system.codedom section from the FX_schema.xml
<sectionSchema name="system.codedom">
<element name="compilers">
<collection addElement="compiler" removeElement="remove" clearElement="clear">
<attribute name="language" type="string" isCombinedKey="true" />
<attribute name="extension" type="string" isCombinedKey="true" />
<attribute name="type" type="string" />
<attribute name="warningLevel" type="int" />
<attribute name="compilerOptions" type="string" />
</collection>
</element>
</sectionSchema>
I am sure that I can not be the the only person who has this problem, but has anyone else anyone come across this before and found a solution?
EDIT: Another way to produce this quickly is (on IIS 7 in Windows 7)
In IIS Managment console, open your MVC website, in the website home. You should see ASP.NET, IIS, and Managment groups. Under Management, open the "Configuration Editor". I get the error message popping up here!
EDIT: My copy of the web config:
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4"
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
I've managed to recreate the error in IIS by simply going to the system.codedom section of the configuration manager.
I don't get any error using either a .net3.5 or .net4.0 app but these are very basic test apps, also only .net3.5 test apps put a system.codedom section in the web.config file by default.
.net4.0 simplified the web.config file and moved out a lot of options
I've found some information here about possible config conflicts which may be of use
It recomends
The workaround for the second scenario
is to delete or comment out all the
system.web.extensions configuration
section definitions and configuration
section group definitions from the
application-level Web.config file.
These definitions are usually at the
top of the application-level
Web.config file and can be identified
by the configSections element and its
children.
For both scenarios, it is recommended
that you also manually delete the
system.codedom section, although this
is not required
Not exactly the same problem but similar
I had an issue very similar to this that I posted and then solved myself and posted the solution I came up with. My solution: I made my own file and placed it in with the schema files. I called it the inventive name ThreeFive.xml and placed it at C:\Windows\System32\inetsrv\config\schema. The entire contents of the file are as follows:
<configSchema>
<sectionSchema name="system.codedom">
<element name="compilers">
<collection addElement="compiler" removeElement="remove" clearElement="clear">
<attribute name="language" type="string" isCombinedKey="true" />
<attribute name="extension" type="string" isCombinedKey="true" />
<attribute name="type" type="string" />
<attribute name="warningLevel" type="int" />
<attribute name="compilerOptions" type="string" />
<collection addElement="providerOption">
<attribute name="name" required="true" isUniqueKey="true" type="string" />
<attribute name="value" required="true" type="string" />
</collection>
</collection>
</element>
</sectionSchema>
</configSchema>
I then published a 3.5 site that retrieved information from an appconfig setting and did some LINQ to make sure the config and the 3.5 were in effect. The config file was not blanked and the LINQ is working as expected so I am tempted to call this a solution.

Resources