文件名不能包含......请输入有效名称 [英] A filename cannot contain ......please enter a valid name

查看:146
本文介绍了文件名不能包含......请输入有效名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在我的项目中添加新页面时,它会给我以下消息,而不允许添加页面。



When i tried to add new page in my project its giving me below message , and not allowing to add the page.

Cannot contain any of the following characters: / ? : & \ * " < > | # %
Cannot contain unicode characters
Cannot contain surrogate characters
Cannot be reserved names including 'CON', 'AUX', 'PRN', 'COM1' or 'LPT2'
Cannot be '.' or '..'

please enter valid name

and it connected with VSS(visual source safe)





我尝试过:



我试过下面的选项

1.从同一个项目中复制已存在的页面然后粘贴它然后尝试重命名它

2.使用已存在的页面创建新页面visual studio并试图添加现有的选项



What I have tried:

I tried below options
1. copied already exists page from the same project and pasted it and then tried to rename it
2.created new page using already exist page outside the visual studio and tried to add existing option

推荐答案

请记住,页面名称是C#中的类名:所以如果你把你的页面称为任何不是合法作为C#变量,然后VS会拒绝它。最常见的错误是尝试使用空格或点:这些终止变量名称因此在类文件名中是非法的。基本上,坚持A-Z,a-z和0-9你会没事的。
Bear in mind that the page name is a class name in C#: so if you call your page anything which isn't legal as a C# variable, then VS will refuse it. The most common fault is to try using a space or a dot: these terminate variable names so are illegal in the class file name. Basically, stick to A-Z, a-z, and 0-9 and you'll be fine.


这篇关于文件名不能包含......请输入有效名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆