'namespace' but is used like a 'type'

前端 未结 7 1714
孤独总比滥情好
孤独总比滥情好 2020-11-27 04:35

This is my program the class uses it is called Time2 I have the reference added to TimeTest I keep getting the Error \'Time2\' is a \'namespace\' but is used like a \'type\'

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 05:35

    I had this problem as I created a class "Response.cs" inside a folder named "Response". So VS was catching the new Response () as Folder/namespace.

    So I changed the class name to StatusResponse.cs and called new StatusResponse().This solved the issue.

提交回复
热议问题