一个大型解决方案中的项目具有两种形式,即A和B。B源自A。我可以邀请设计人员加入A,但是当我尝试设计B时,设计人员说找不到A。该项目可以编译并完美运行。
这不是问题,直到我安装了VS 2017的最新更新。我刚刚安装了15.9.12,问题仍然存在。在VS 2019中,其行为方式相同。
我收到此消息:“无法显示该文件的设计器,因为无法设计该文件中的所有类。设计器检查了文件中的以下类:(B)---基类'( A)'无法加载。请确保已引用该程序集并已构建所有项目。“
我在另一个项目中也遇到类似的问题,其中用户控件(A)的设计完美,但是在设计包含A的另一个用户控件(在同一项目中)时,我收到此消息:“找不到类型' (A)'。请确保引用了包含此类型的程序集。如果此类型是开发项目的一部分,请确保已使用当前平台或任何CPU的设置成功构建了该项目。“ < / p>
我还注意到该项目的工具箱中没有A,我认为这是相关的。
有人知道为什么一个项目中的类在同一项目中找不到类吗?对我来说完全是无稽之谈。有几个项目存在这种问题。
涉及很多代码,我看不出其中有什么用,因为问题似乎与设计者有关,但是如果有人认为有帮助,我可以发布代码。
我将发布.csproj内容(如果有用)以及fmShout的类声明,这是设计者无法显示的形式。
这里是声明:公共局部类fmShout:fmBaseForAutoFlash {
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProjectGuid>{188FA8B2-F290-402C-9ABB-C3B02CCF5E85}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BaseOther</RootNamespace>
<AssemblyName>BaseOther</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="CesUtilities, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\CesLibraries\CesUtilities\bin\Release\CesUtilities.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data.SQLite, Version=1.0.110.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.110.0\lib\net46\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.EF6, Version=1.0.110.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.110.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.Linq, Version=1.0.110.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.110.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="cAfEMail.cs" />
<Compile Include="cG.cs" />
<Compile Include="cHandleKeys.cs" />
<Compile Include="cOptionSet.cs" />
<Compile Include="fmBaseForAutoFlash.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="fmBaseForAutoFlash.Designer.cs">
<DependentUpon>fmBaseForAutoFlash.cs</DependentUpon>
</Compile>
<Compile Include="fmShout.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="fmShout.Designer.cs">
<DependentUpon>fmShout.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="fmBaseForAutoFlash.resx">
<DependentUpon>fmBaseForAutoFlash.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="fmShout.resx">
<DependentUpon>fmShout.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BaseDataAccess\BaseDataAccess.csproj">
<Project>{bce171ea-a58c-4bc9-bf87-4f7b626a8609}</Project>
<Name>BaseDataAccess</Name>
</ProjectReference>
<ProjectReference Include="..\BaseData\BaseData.csproj">
<Project>{637c5f94-81e2-4795-aae1-71562378470e}</Project>
<Name>BaseData</Name>
</ProjectReference>
<ProjectReference Include="..\Base\Base.csproj">
<Project>{ce828c0e-5cdd-4fcc-8ada-2e03173084d4}</Project>
<Name>Base</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- 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>