WebSphere MQ - error running runivt on fresh install - wcf

I am trying to execute the RUNIVT tests on a fresh install of Websphere MQ 7.5.0.2 for Windows, but hitting this error:
14/06/15 08:48:28 - Process(20900.1) User(bobble) Program(amqswsdl.exe)
Host(bobblespc) Installation(Installation1)
VRMF(7.5.0.2)
AMQ9920: A SOAP Exception has been thrown.
EXPLANATION:
A SOAP method encountered a problem and has thrown an exception. Details of the
exception are:
'System.InvalidCastException: Unable to cast transparent proxy to type
'MQSOAPHost'. at MQWSDL.Main(String[] args)'
ACTION:
Investigate why the SOAP method threw the exception.
----- MQWSDL.Main : 0 ---------------------------------------------------------
when the line:
amqswsdl "jms:/queue?destination=SOAPN.demos#WMQSOAP.DEMO.QM&connectionFactory=(connectQueueManager(WMQSOAP.DEMO.QM))&initialContextFactory=com.ibm.mq.jms.Nojndi&targetService=StockQuoteDotNet.asmx&replyDestination=SYSTEM.SOAP.RESPONSE.QUEUE" StockQuoteDotNet.asmx generated\StockQuoteDotNet_Wmq.wsdl
is called.
I cannot find any detail on the error or why I might be getting it? Any assistance gratefully received!
I found this in the bin folder - it's the redirect for the XMS namespace...and redirects to a version I don't have installed? The WCF version redirects v6 & v7.0 to v7.5.
I don't know where or how this is installed - or where it's stored in Windows...but when I try and run any of the sample apps, they fall down as unable to load assembly v 2.5.0.2 of IBM.XMS
<configuration>
<!-- 1.7 clients/dotnetclient/src/code/PublisherPolicy/XmsPublisherPolicy.config, netClient, nn00 -->
<!-- Publisher policy file IBM.XMS -->
<!-- Redirects to version 2.5.0.2 of the assembly. -->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- publisher policy for IBM.XMS.dll -->
<dependentAssembly>
<assemblyIdentity name="IBM.XMS"
publicKeyToken="d2666ab12fca862b"
culture="Neutral" />
<bindingRedirect oldVersion="1.1.1.2-2.5.0.2"
newVersion="2.5.0.2"/>
</dependentAssembly>
<!-- publisher policy for IBM.XMS.Client.Impl.dll -->
<dependentAssembly>
<assemblyIdentity name="IBM.XMS.Client.Impl"
publicKeyToken="d2666ab12fca862b"
culture="Neutral" />
<bindingRedirect oldVersion="1.1.1.2-2.5.0.2"
newVersion="2.5.0.2"/>
</dependentAssembly>
<!-- publisher policy for IBM.XMS.Provider.dll -->
<dependentAssembly>
<assemblyIdentity name="IBM.XMS.Provider"
publicKeyToken="d2666ab12fca862b"
culture="Neutral" />
<bindingRedirect oldVersion="1.1.1.2-2.5.0.2"
newVersion="2.5.0.2"/>
</dependentAssembly>
<!-- publisher policy for IBM.XMS.Util.dll -->
<dependentAssembly>
<assemblyIdentity name="IBM.XMS.Util"
publicKeyToken="d2666ab12fca862b"
culture="Neutral" />
<bindingRedirect oldVersion="1.1.1.2-2.5.0.2"
newVersion="2.5.0.2"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Related

Published WCF service on azurewebsites.net does not return sql record

I am trying to create an API using visual basic for an iPhone app. To do this, I have written a WCF web service which runs perfectly fine on localhost.
Calling: getTimeSheetRecord/{deviceID} returns
The image above shows that the code is able to connect to the SQL database and returns the record.
As I need to be able to access the API from outside my company network, I am required to host it to be accessible from anywhere. Therefore I have used Build -> Publish to create Microsoft Azure App Server in Visual Studio 2015. Everything went well, until I ran my function to return a database record. It does not give me the same result as in localhost, in fact, I think it does not even have a connection to the database. Please see the image below:
The image above is the published WCF that I am trying to get to work. This does not return the record as it did shown in the previous image. The code is not any different since all I did was publish it through visual studio 2015.
My WCF is connected to the MS SQL Server that is running in an Azure VM.
This is the code within my WCF to connect to the database:
Imports System.Configuration
Imports System.Data.SqlClient
Module modGlobal
'Global Database Objects
Public uDBase As ADODB.Connection
Public uCommand As ADODB.Command
Public bConnection As Boolean
Public bActive As Boolean = True
Public sErrDescription As String
Public Sub OpenConnection()
'** Open Database Connection
' Error Checking
On Error GoTo Err_OpenConnection
' Open Database Connection
uDBase = New ADODB.Connection
uDBase.ConnectionString = "Provider=SQLOLEDB;Initial Catalog=BMSSaltire;Data Source=tcp:xxxxxxxx.cloudapp.net,xxxxx;User ID=xxxxxUser;Password=xxxxx"
uDBase.CommandTimeout = 0
uDBase.Open()
Err_OpenConnection:
If Err.Number <> 0 Then
CloseConnection()
If
End Sub
Sub CloseConnection()
'** Close Database Connection
uDBase = Nothing
uCommand = Nothing
End Sub
End Module
And this is my Service.svc.vb
Public Function GetTimeSheetRecord(ByVal deviceID As String) As List(Of wsTimeSheet) Implements ServiceInterface.GetTimeSheetRecord
Dim results As List(Of wsTimeSheet) = New List(Of wsTimeSheet)
Try
Dim uRecSnap As ADODB.Recordset
If uDBase Is Nothing Then
OpenConnection()
bConnection = True
End If
uCommand = New ADODB.Command
With uCommand
.ActiveConnection = uDBase
.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc
.CommandTimeout = 0
.Parameters.Append(.CreateParameter("#DeviceID", ADODB.DataTypeEnum.adVarChar, ADODB.ParameterDirectionEnum.adParamInput, 32, deviceID))
.CommandText = "TimeSheet_LoadRecord"
uRecSnap = .Execute
End With
Do Until uRecSnap.EOF
Dim uAction = New wsTimeSheet
uAction.DeviceID = If(IsDBNull(uRecSnap("ActionDate").Value), "", uRecSnap("ActionDate").Value)
results.Add(uAction)
uRecSnap.MoveNext()
Loop
uRecSnap = Nothing
Catch ex As Exception
' Catch Error
If Err.Number <> 0 Then
End If
Finally
' CleanUp
If bConnection Then CloseConnection()
End Try
Return results
End Function
Also when I try to publish, in Settings it says under Databases that "No databases found in the project".
EDIT 08/03/2016
I have tried to see if it is any different when I publish it to the localhost IIS, but even then it does not return the records from the SQL database tables. It works fine when I debug it on Visual Studio using the virtual directory that I have set up under "Web" in Settings. Does it have anything to do with the Web.config?
Try and put the connection string as a setting in your cloud project.
Right-click on the properties of the project
Select "Settings"
Click "Add Setting"
By the way, does your connection string in the code match the one you can see in the Azure portal?
Hope it helps.
/Fredrik
I have got my WCF working. There were a few small adjustments I had to do in my Web.config and change my ADODB reference property Copy Local = True and Embed Interop Type = False.
This is my Web.config file. Hope someone finds it useful.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<!--<add key="saltireServiceUrl" value="http://[sitename].azurewebsites.net/Service1.svc" />-->
</appSettings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<services>
<service name="JSONWebService.Service1" behaviorConfiguration="JSONWebService.Service1Behaviour">
<endpoint address="" behaviorConfiguration="webBehaviour" binding="webHttpBinding" contract="JSONWebService.ServiceInterface" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="JSONWebService.Service1Behaviour">
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webBehaviour">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://[sitename].azurewebsites.net/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<httpErrors errorMode="Detailed" />
<validation validateIntegratedModeConfiguration="false"/>
<!--
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" />
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers></system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

WIX how to remove xmlns="" tag

I have a wix project that installs a web site. One of the steps adds several xml tags to web.config file. Whenever adding xml tags WIX adds xmlns="" attribute which I don't want.
PluginSettings.wxi
<?xml version="1.0" encoding="utf-8"?>
<Include>
...
<?define PluginProbingPath="<probing privatePath="IntegrityChecker\bin\" />" ?>
</Include>
ConfigFiles.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include PluginSettings.wxi ?>
<Fragment>
<!-- WEB.CONFIG -->
<Component Id="Web.ConfigPortal" Guid="3ED81B77-F153-4003-9006-4770D789D4B7" Directory ="INSTALLDIR">
<CreateFolder/>
...
<util:XmlConfig Id = "AppConfigAddPlugin1" ElementPath = "//configuration/runtime/assemblyBinding" Action = "create" Node = "document"
On = "install" File = "[INSTALLDIR]web.config" Value = "$(var.PluginProbingPath)" Sequence = "1"/>
</Component>
</Fragment>
</Wix>
Which results in web.config having this after install:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
...
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0"/>
</dependentAssembly>
<probing xmlns="" privatePath="IntegrityChecker\bin\"/></assemblyBinding>
</runtime>
As you can see nowhere did I specify xmlns tag (which I DON"T want).
I've tried removing that attribute with additional tag but it doesn't work:
<util:XmlFile Id="AppConfigAddPlugin8" Action="deleteValue" Permanent="yes" File="[INSTALLDIR]web.config"
ElementPath="//configuration/runtime/assemblyBinding/probing" Name="xmlns" Sequence = "2"/>
what am I doing wrong?
The WIX XmlConfig extension uses MSXML to modify the XML file on the target computer. Specifically the attributes action="create" and node="document", results in this simplified sequence of MSXML calls:
selectSingleNode("//configuration/runtime/assemblyBinding")
Create new xml document from: <probing privatePath=\"IntegrityChecker\bin\" />
Get the top level document element
call appendChild() to append the new document element
The problem is the probing element has no name space, but the parent assemblyBinding element has the namespace "urn:schemas-microsoft-com:asm.v1". When MSXML adds the probing element, xmlns="" is added to reset the default namespace. Without xmlns="", the probing element inherits the "urn:schemas-microsoft-com:asm.v1" namespace.
The article, MSXML inserted blank namespaces, describes this behaviour. Unfortunately this article (and others) recommend changing the call sequence to specify a default namespace when adding the probing element. Since this is WIX we can't easily change how WIX uses MSXML.
You could try adding a namespace to the probing element:
<?define PluginProbingPath="<probing xmlns="urn:schemas-microsoft-com:asm.v1" privatePath="IntegrityChecker\bin\" />" ?>
This will result in:
<probing xmlns="urn:schemas-microsoft-com:asm.v1" privatePath="IntegrityChecker\bin\" />
I'm not an expert on xml namespaces, but the effect of the explicit xmlns="urn:schemas-microsoft-com:asm.v1" should be benign in that the probing element will now have the same default namespace as its parent assemblyBinding. Whether this is a suitable work around depends on what is consuming the xml.

WebAPI OData 5.0 Beta - Accessing GlobalConfiguration throws Security Error

I recently installed the pre-release version of the WebApi OData 5.0 framework to play with the new $expand support. Everything built okay, but I get a strange exception on App_Start.
Attempt by security transparent method
'System.Web.Http.GlobalConfiguration.get_Configuration()'
to access security critical type 'System.Web.Http.HttpConfiguration' failed.
Source Error:
Line 12: protected void Application_Start()
Line 13: {
Line 14: WebApiConfig.Register(GlobalConfiguration.Configuration); // <--
Line 15: }
Stack Trace:
[TypeAccessException: Attempt by security transparent method 'System.Web.Http.GlobalConfiguration.get_Configuration()' to access
security critical type 'System.Web.Http.HttpConfiguration' failed.]
System.Web.Http.GlobalConfiguration.get_Configuration() +0
API.WebApiApplication.Application_Start() in Global.asax.cs:14
[HttpException (0x80004005): Attempt by security transparent method 'System.Web.Http.GlobalConfiguration.get_Configuration()' to access
security critical type 'System.Web.Http.HttpConfiguration' failed.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12863325
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Attempt by security transparent method 'System.Web.Http.GlobalConfiguration.get_Configuration()' to access
security critical type 'System.Web.Http.HttpConfiguration' failed.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12880068
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12721257
Google reveals very little.
Run following commands in Package manager Console, in the given order:
Uninstall-Package Microsoft.AspNet.Mvc.FixedDisplayModes
Update-Package Microsoft.AspNet.Mvc -Pre
Update-Package Microsoft.AspNet.WebApi -Pre
Update-Package Microsoft.AspNet.WebApi.Tracing
Now, apply following changes to web.config:
In the Web.config of your project, update value of app setting webpages:version to 3.0.0.0
Under the section runtime in the web.config, check version of each assembly configured and update it to the version of assembly added to your project. Following is the updated configuration in my web.config:
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" /> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime>
Open the web.config from Views folder. There are three things to be updated here:
Under configSections, update versions of the Razor assemblies as 3.0.0.0.
Update version of host under system.web.webPages.razor section, update version of System.Web.Mvc.MvcWebRazorHostFactory as 3.0.0.0.
There are a few version numbers mentioned under pages section of System.web. Update all of them to version 5.0.0.0
If you have Web API Help Pages installed, check for the above assembly configurations there as well.
I was having this same error. I just tweaked Ravi's answer a little bit and found that updating the WebApi package follwed by updating/installing WebApi.OData 5.0.0-rc1 package worked well enough for me. I just ran these at the package manager:
Update-Package Microsoft.AspNet.WebApi -Pre
Install-Package Microsoft.AspNet.WebApi.OData -Version 5.0.0
I'm guessing that the prerelease versions of WebApi.OData package has some dependency with a newer version of WebApi package that Nuget fails to inspect as a dependency. Then again, I am technically a newbie with WebApi OData and don't know much about the packages yet but, yeah, I can run the project with $expand and $select functionality and none of the GlobalConfiguration error. :)
I am not sure what the exact reason for this would be, but I generally see this error when one of the nuget packages is an older version (non pre-release). Could you try upgrading all your nuget packages and see if this goes away.
All you need to do is run the command "update-package Microsoft.AspNet.WebApi" in the Package Manager Console for the VS solution

Default Role Provider could not be found when using SimpleMembershipProvider

I'm trying to get authorization working on asp.net mvc4, so I try to use WebSecurity.
WebSecurity.InitializeDatabaseConnection("tradefairindia", "Users", "Id", "Username", false);
I've put this into Global.asax, and this is where the error comes, "Default Role Provider could not be found".
On the internet I read that I had to add this line of code to my web.config <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">. But I had it added already because of previous errors.
How can I resolve this problem??
Edit:
When I change it to defaultProvider="SimpleRoleProvider" it gives me a new error. It says
The type or namespace name 'Data' does not exist in the namespace 'WebMatrix' (are you missing an assembly reference?)
I fixed it by changing the defaultProvider to SimpleRoleProvider. The second error I fixed by adding Webmatrix.data as a reference, and going to its property's and put copy local on true. I dont know how this fixes it, if anyone can elaborate that would be nice.
Here is my web.config for anyone who bumps into the same prob:
<system.web>
//...
<membership defaultProvider="SimpleMembershipProvider">
<providers>
<clear />
<add name="SimpleMembershipProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="SimpleRoleProvider">
<providers>
<clear />
<add name="SimpleRoleProvider" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData" />
</providers>
</roleManager>
//...
</system.web>

Running ServiceStack side by side with MVC

I managed to run ServiceStack side by side with MVC4, but I still have a little problem and hope someone can help me with that.
When executing a debugging session through VS2012, everthying works perfect - the browser is opened and the first page is loaded well. But then when refreshing the page, and trying to get to http://localhost:62322/Content/site.css, the following error is displayed:
Handler for Request not found:
Request.ApplicationPath: /
Request.CurrentExecutionFilePath: /Content/site.css
Request.FilePath: /Content/site.css
Request.HttpMethod: GET
Request.MapPath('~'): D:\All\Projects\ExampleProject\trunk\ExampleProject\ExampleProject\
Request.Path: /Content/site.css
Request.PathInfo:
Request.ResolvedPathInfo: /Content/site.css
Request.PhysicalPath: D:\All\Projects\ExampleProject\trunk\ExampleProject\ExampleProject\Content\site.css
Request.PhysicalApplicationPath: D:\All\Projects\ExampleProject\trunk\ExampleProject\ExampleProject\
Request.QueryString:
Request.RawUrl: /Content/site.css
Request.Url.AbsoluteUri: http://localhost:62322/Content/site.css
Request.Url.AbsolutePath: /Content/site.css
Request.Url.Fragment:
Request.Url.Host: localhost
Request.Url.LocalPath: /Content/site.css
Request.Url.Port: 62322
Request.Url.Query:
Request.Url.Scheme: http
Request.Url.Segments: System.String[]
App.IsIntegratedPipeline: False
App.WebHostPhysicalPath: D:\All\Projects\ExampleProject\trunk\ExampleProject\ExampleProject
App.DefaultHandler: DefaultHttpHandler
App.DebugLastHandlerArgs: GET|/Content/site.css|D:\All\Projects\ExampleProject\trunk\ExampleProject\ExampleProject\Content\site.css
But if I delete the following line of code in AppHost.cs, everything works well, and the handler for site.css is always found:
SetConfig(new EndpointHostConfig { ServiceStackHandlerFactoryPath = "api", DefaultContentType = ContentType.Json });
My requirements for the project are wrapping with ServiceStack any call through the browser (all controllers) as well as calls to /api, which should be handled by a ServiceStack service.
I followed the instructions here:
https://github.com/ServiceStack/ServiceStack/wiki/Run-servicestack-side-by-side-with-another-web-framework
and my web.config looks like this:
<system.web>
<!--...-->
<httpHandlers>
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" />
</httpHandlers>
<!--...-->
</system.web>
<location path="api">
<system.web>
<httpHandlers>
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" />
</httpHandlers>
</system.web>
<!-- Required for IIS 7.0 -->
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
</handlers>
</system.webServer>
</location>
Does anybody know why the handler for site.css sometimes found and sometimes not?
Furthermore, if I did a mistake with configuring ServiceStack to wrap my whole server, please point me to them.
From what you are trying to do I would recommend starting with a plain ASP.NET Web Application. Once your project is set, using NuGet you could do
Install-Package ServiceStack.Host.AspNet
or just follow the configuration here. Doing this runs ServiceStack at the root path /.
In your set up above you don't need this line...
SetConfig(new EndpointHostConfig { ServiceStackHandlerFactoryPath = "api", DefaultContentType = ContentType.Json });
Adding it is telling ServiceStack to only handle requests that contain the '/api' path which is not what you want.