-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
feature-mvc-testingMVC testing packageMVC testing packageinvestigateold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Having issue with the latest Microsoft.AspNetCore.Mvc.Testing with version 6.0.7 in the integration tests project.
This is the .csproj of the integration tests project.
I'm getting the MSB4186 error when I tried to build the integration tests project, I'm able to run the web app project directly without issue but not the integration test project.
4>C:\xxx\.nuget\packages\microsoft.aspnetcore.mvc.testing\6.0.7\build\net6.0\Microsoft.AspNetCore.Mvc.Testing.targets(34,9): error MSB4186: Invalid static method invocation syntax: "[System.IO.Path]::GetDirectoryName(C:\xxx\src\Template.Project.Core\Template.Project.Core.csproj)". Method 'System.IO.Path.GetDirectoryName' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). Check that all parameters are defined, are of the correct type, and are specified in the right order.
According to #31066, I tried to remove the condition in the targets but the project still failed to build.
Expected Behavior
The project is built successfully.
Steps To Reproduce
- Create a net6.0 class library with the name
Template.Project.Core
. - Create a net6.0 class library with the name
Template.Project.Infrastructure
. - Create a net6.0 ASP.Net Core Web App (MVC) with the name
Template.Project.WebApp
. - Create a net6.0 NUnit Test Project with the name
Template.Project.IntegrationTests
. - Follow the instruction in https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-6.0#aspnet-core-integration-tests.
- Build the integration tests project.
UPDATE 1
Rename the parent level folder to include )
, the issue occurs when the full path contains )
.
Exceptions (if any)
No response
.NET Version
6.0.302
Anything else?
No response
Metadata
Metadata
Assignees
Labels
feature-mvc-testingMVC testing packageMVC testing packageinvestigateold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels