我正在使用 Visual Studio 2015 创建一个空白的 UWP
我每次尝试构建时都会收到以下错误
Error CS1061 'MainPage' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'MainPage' could be found (are you missing a using directive or an assembly reference?)
Error Value cannot be null.
Parameter name: path1
我尝试卸载 Windows 软件开发工具包,然后安装它,但没有成功
我有一个工作项目,但现在它给出了同样的错误
.csproj中的目标如下
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
最佳答案
确保命名空间在文件 MainPage.xaml.cs 和 MainPage.xaml 中都是正确的。
例子:-
交叉检查后,如果同样的问题仍然存在,则从解决方案中删除 obj 和 bin 文件夹,然后再次重建解决方案。
关于c# - UWP 值不能为空。参数名称 : path1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41347428/