【发布时间】:2018-10-05 20:44:28
【问题描述】:
我的项目找不到命名空间。有人知道问题出在哪里吗?
我已经尝试了很多方法来解决这个问题。但没有一个有效。
我尝试过:清理解决方案、构建解决方案、重构和
右键单击解决方案,然后单击属性。
点击左侧的配置。
确保选中为找不到的项目构建下的复选框。
如果已经勾选,取消勾选,点击应用并再次勾选。
这是我的代码的屏幕截图。 screenshot of code
<Project ToolsVersion="15.0" 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)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DD7D144A-06C0-482A-9142-3CD989CCC7A4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NTier.BLL</RootNamespace>
<AssemblyName>NTier.BLL</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Admin\AdminLogic.cs" />
<Compile Include="Customer\CustomerLogic.cs" />
<Compile Include="Admin\IAdminLogic.cs" />
<Compile Include="Customer\ICustomerLogic.cs" />
<Compile Include="Customer\INotRegularCustomerLogic.cs" />
<Compile Include="Customer\IRegularCustomerLogic.cs" />
<Compile Include="Customer\NotRegularCustomerLogic.cs" />
<Compile Include="Customer\RegularCustomerLogic.cs" />
<Compile Include="Order\IOrderLogic.cs" />
<Compile Include="Order\OrderLogic.cs" />
<Compile Include="Product\IProductLogic.cs" />
<Compile Include="Review\IReviewLogic.cs" />
<Compile Include="Product\ProductLogic.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Review\ReviewLogic.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NTier.DAL\NTier.DAL.csproj">
<Project>{a42bdcd5-0ec1-4d2a-b96a-92e39138e9cb}</Project>
<Name>NTier.DAL</Name>
</ProjectReference>
<ProjectReference Include="..\NTier.Domain\NTier.Domain.csproj">
<Project>{70a4d682-67bb-456b-a21d-f343b43fe1b6}</Project>
<Name>NTier.Domain</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
这是您要求的代码。希望你能帮助解决我的问题。
【问题讨论】:
-
您在哪里定义了“Product”类,可能是在引用的项目中?能否请您分享 .csproj 文件?
-
看新帖。我无法在此评论中分享代码。
-
请编辑您的问题并添加 .csproj 文件内容
-
我需要查看项目 .csproj 文件,而不是 Product 类
-
我什至无法进入我的 .csproj 文件 ....
标签: c# asp.net class namespaces n-tier-architecture