VirtualPathRoot is null in owin self-hosted environment
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 864
- Forks
- 467
- PR merge metrics
- No merged PRs in 30d
Description
System.ArgumentNullException is raised when receiving batch requests due to VirtualPathRoot is null in owin self-hosted environment
Reproduce steps
Create a Owin Self-Hosted WebApi Application (Odata V4) and register ODataBatchHandler as in below code to handle Odata batch request.
public void Configuration(IAppBuilder app)
{
...
HttpConfiguration config = new HttpConfiguration()
ODataBatchHandler batchHandler = new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer);
...
config.EnsureInitialized();
}
Send a Batch request to Odata end point.
Expected result
Batch request should be prosessed.
Actual result
An Exception is occured.
Value cannot be null. Parameter name: virtualPathRoot ExceptionType : System.ArgumentNullException
Additional details
GlobalConfiguration.DefaultServer.Configuration.VirtualPathRoot is null in Self Hosted App but VirtualPathRoot has a value = "/" in ISS hosted environment.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Owin self-hosted Web API setup with DefaultODataBatchHandler and a batch request. Trace where GlobalConfiguration.DefaultServer.Configuration.VirtualPathRoot is consumed and compare the self-hosted and IIS-hosted values. Done means batch requests process without the virtualPathRoot ArgumentNullException in self-hosted mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100