微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么我收到此警告项目文件中找不到.cs文件

如何解决为什么我收到此警告项目文件中找不到.cs文件

|| 警告1在项目文件中找不到文件\'........ \\ Window1.xaml.cs \'的父文件\'Window1.xaml \'。 WpfApplication1 为什么会这样呢? 编辑:打开wpfapplication1.csproj文件
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<Project Toolsversion=\"3.5\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">
  <PropertyGroup>
    <Configuration Condition=\" \'$(Configuration)\' == \'\' \">Debug</Configuration>
    <Platform Condition=\" \'$(Platform)\' == \'\' \">Anycpu</Platform>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{1656975F-4108-4386-80CB-00176DF48895}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>WpfApplication1</RootNamespace>
    <AssemblyName>WpfApplication1</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=\" \'$(Configuration)|$(Platform)\' == \'Debug|Anycpu\' \">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\\Debug\\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=\" \'$(Configuration)|$(Platform)\' == \'Release|Anycpu\' \">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\\Release\\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include=\"System\" />
    <Reference Include=\"System.Core\">
      <requiredTargetFramework>3.5</requiredTargetFramework>
    </Reference>
    <Reference Include=\"System.Windows.Forms\" />
    <Reference Include=\"System.Xml.Linq\">
      <requiredTargetFramework>3.5</requiredTargetFramework>
    </Reference>
    <Reference Include=\"System.Data.DataSetExtensions\">
      <requiredTargetFramework>3.5</requiredTargetFramework>
    </Reference>
    <Reference Include=\"System.Data\" />
    <Reference Include=\"System.Xml\" />
    <Reference Include=\"WindowsBase\" />
    <Reference Include=\"PresentationCore\" />
    <Reference Include=\"PresentationFramework\" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDeFinition Include=\"App.xaml\">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </ApplicationDeFinition>
    <Page Include=\"Window1.xaml\">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Compile Include=\"App.xaml.cs\">
      <DependentUpon>App.xaml</DependentUpon>
      <SubType>Code</SubType>
    </Compile>
    <Compile Include=\"..\\..\\..\\..\\Window1.xaml.cs\">
      <DependentUpon>Window1.xaml</DependentUpon>
      <SubType>Code</SubType>
      <Link>Window1.xaml.cs</Link>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <Compile Include=\"Properties\\AssemblyInfo.cs\">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include=\"Properties\\Resources.Designer.cs\">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include=\"Properties\\Settings.Designer.cs\">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
    <EmbeddedResource Include=\"Properties\\Resources.resx\">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <None Include=\"Properties\\Settings.settings\">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <AppDesigner Include=\"Properties\\\" />
  </ItemGroup>
  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />
  <!-- To modify your build process,add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist,see Microsoft.Common.targets.
  <Target Name=\"BeforeBuild\">
  </Target>
  <Target Name=\"AfterBuild\">
  </Target>
  -->
</Project>
您如何在这里分析文件路径?我不太明白

解决方法

如果在文本编辑器中检查WpfApplication1.csproj文件,则该文件应具有Window1.xaml和Window1.xaml.cs文件的条目。 您必须确保xaml和CS文件位于项目文件认为的位置。,尝试更改文件“ 2”在“ 1”中的路径,
<ItemGroup>
   ....
   <Compile Include=\"Window1.xaml.cs\"> <!--Changed path-->
      <DependentUpon>Window1.xaml</DependentUpon>
      <SubType>Code</SubType>
      <Link>Window1.xaml.cs</Link>
   </Compile>
</ItemGroup>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?