11

我正在通过 VS2010 添加一个项目来执行,但我不断收到'file' not under client's root项目中所有文件的此错误。我似乎无法弄清楚这一点。

这是我正在做的事情:

1)打开尚未执行的VS2010项目。

2)我选择将solotion添加到perforce(从文件>源代码控制>添加解决方案菜单)。

3) 我选择了一个新的工作区。它带来了工作区的属性。根文件夹默认为 c:\Users\My.Name。我将其更改为我的项目所在的文件夹。我还更改了视图,使其指向说 depot\main\new_project。

它似乎已经添加了项目,但是当我签入文件时它就不起作用了!它为所有'file not under client's root'.

我也直接去perforce查看对应工作区的设置。在仪表板中显示错误:

P4V is having trouble translating the location "c:\Users\user.Name\Documents\Code\My_Project" to a valid workspace location. To filter using this location, drag the folder from the workspace tree to the workspace folder field or include the depot location in your workspace view.

有人可以给我任何指示,为什么这不起作用?

更新 我的工作区映射是这个

Client:  omega
Owner:   User.Name
Root:    C:\Users\User.Name\Documents\Visual Studio 2010\Projects\Omega
LineEnd: local
View:
         //depot/main/omega/...     //omega/...
4

7 回答 7

22

If you get this error while the "Pending" Tab is open, the following could be your problem! You may not be seeing your entire filter (ie. some of the filter may be out of view). Mouse over your Window Pane Border underneath the filter until your cursor changes so that you can expand the Filter Window Pane. There is a filter that could be there that says, "Files that match any of the following file paths:" Make sure that you don't have a file path selected that is incorrect. Either remove the filter or choose "Current depor or workspace tree selection".

于 2013-03-25T18:15:28.840 回答
4

What I believe is that you have a different path for your client and your code is in different path. From you P4V error I see that the path is:

c:\Users\user.Name\Documents\Code\My_Project

But your client root path is:

C:\Users\User.Name\Documents\Visual Studio 2010\Projects\Omega

In above scenario, the path only upto "C:\Users\User.Name\Documents" is common, after that your client root and your project root differs. If you want to check in code from your My_Project folder, change the client root to point to that. You can do so on command line by

p4 client <client name>

Or change it in Workspace view of P4V.

Also, make sure to use "" around your path since it has folder name with space.

Hope this helps.

于 2012-09-17T06:06:17.007 回答
1

One 'oops' mistake you can make is to have the wrong workspace selected in Visual Studio 2012. Just did that and spent a few minutes scratching my head.

于 2013-09-30T21:30:53.053 回答
1

This exact problem was related to my "PENDING VIEW". It had a search filter set for the default workspace at the time, and any time I switched to a different workspace it would show the error dialog.

The deal was I had changed the workspace name, and the filter was no longer valid.

I cleared the filter (in the pending view) and the error disappeared.

于 2016-09-08T19:12:41.153 回答
0

我猜 Perforce 在你的路径中存在空格问题。试着在它周围加上引号。

来自http://www.perforce.com/perforce/doc.current/manuals/p4guide/03_using.html

Spaces in filenames, pathnames, and identifiers Use quotation marks to enclose files or directories that contain spaces. For example: "//depot/dev/main/docs/manuals/recommended configuration.doc" If you specify spaces in names for other Perforce objects, such as branch names, client names, label names, and so on, the spaces are automatically converted to underscores by the Perforce server.

于 2012-09-14T20:10:52.277 回答
0

I had similar error message showing during project build. What helped was deleting .suo file and reloading the project as described in How does Visual Studio's source control integration work with Perforce?

于 2013-07-09T14:51:39.560 回答
0

Check the path specified in the client Root. If this is not a valid path then you encounter this error

Root:   /a/b/c/d

If this is not a valid root you end up getting the following error

Path '/a/b/c/d/...' is not under client's root '/a/b/c/d'

Just correct the path pointed to by Root and you should be fine

于 2014-01-09T09:02:26.907 回答