net*_*jor 56 msbuild projects-and-solutions visual-studio-2010
我有Visual Studio 2010的错误:
错误1在"Sources"参数中多次指定"CrossDomainService.svc.cs"项."Sources"参数不支持重复项.WcfServiceDomain
并从msbuild
C:\ Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(160,9):错误MSB3105:"Sources"参数中指定的项目"CrossDomainService.svc.cs"超过了oce ."Sources"参数不支持重复项.[C:\ inetpub\Wwwroot\axaptaWcfConnection\WcfServiceDomain\WcfSer viceDomain.csproj]
我的文件是csproj:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8D40933A-E036-4CD0-9003-314A692724D5}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WcfServiceDomain</RootNamespace>
<AssemblyName>WcfServiceDomain</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>4.0</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Configuration" />
<Reference Include="System.Drawing" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Web" />
<Reference Include="System.Web.Services" />
</ItemGroup>
<ItemGroup>
<Content Include="ClientAccessPolicy.xml" />
<Content Include="CrossDomainService.svc" />
<Content Include="Service1.svc" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="CrossDomainService.svc.cs">
<DependentUpon>CrossDomainService.svc</DependentUpon>
</Compile>
<Compile Include="ICrossDomainService.cs" />
<Compile Include="Service1.svc.cs">
<DependentUpon>Service1.svc</DependentUpon>
</Compile>
<Compile Include="IService1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>51421</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
</Project>
Run Code Online (Sandbox Code Playgroud)
我没有看到任何重复:/这个错误的任何想法?
Net*_*ter 98
我在我的解决方案中面临同样的问题,其中一个源文件存在相同的错误,
我修好了如下,
检查给出错误的文件名.
找出包含文件的项目.
打开该特定项目的.csproj文件(该文件可以在放置解决方案的目录中找到).
搜索.csproj文件中引发错误的文件名.
你会发现该行的两个条目,如
Run Code Online (Sandbox Code Playgroud)<Compile Include="duplicate.aspx.cs"> <SubType>ASPXCodeBehind</SubType> <DependentUpon>Duplicate.aspx</DependentUpon> </Compile> <Compile Include="duplicate.aspx.cs"> <SubType>ASPXCodeBehind</SubType> <DependentUpon>Duplicate.aspx</DependentUpon> </Compile>
从其中一行中删除任意一行.
保存更改.
重新加载项目,你的错误肯定已经消失.
小智 5
对于遇到相同问题的人,没有任何帮助他们,他们不想重新创建项目:尝试删除YourPojectName.csproj.user文件.它帮助了我.我之前手动修改了.csproj,并且引入了修改(不知何故)可能与这两个文件存在一些差异.
| 归档时间: |
|
| 查看次数: |
32568 次 |
| 最近记录: |