Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3964892
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:23:22+00:00 2026-05-20T03:23:22+00:00

I have the following proj file: <?xml version=1.0 encoding=utf-8?> <Project ToolsVersion=4.0 DefaultTargets=Build xmlns=http://schemas.microsoft.com/developer/msbuild/2003> <PropertyGroup>

  • 0

I have the following proj file:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{4B942FFC-22E5-486B-A3D7-D5EDFFF016F8}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Args</RootNamespace>
    <AssemblyName>Args</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <SccProjectName>Svn</SccProjectName>
    <SccLocalPath>Svn</SccLocalPath>
    <SccAuxPath>Svn</SccAuxPath>
    <SccProvider>SubversionScc</SccProvider>
  </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>
    <Framework>NET40</Framework>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release35|AnyCPU'">
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release3.5\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Args.cs" />
    <Compile Include="ArgumentDefinition.cs" />
    <Compile Include="ArgumentParser.cs" />
    <Compile Include="DefaultModelBinder.cs" />
    <Compile Include="IArgumentParser.cs" />
    <Compile Include="IModelBinder.cs" />
    <Compile Include="InternalExtenstions.cs" />
    <Compile Include="ModelBinders.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
  </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">
    <MSBuild Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU'"
     Projects="$(MSBuildProjectFile)"    
     Properties="Configuration=Release35" />
  </Target>
</Project>

This is my expected result when I compile the project in Release|AnyCPU:

  • The dll and pdb file for the project to be located in the bin\Release directory, compiled against the 4.0 framework.
  • The dll and pdb file for the project to be located in the bin\Release3.5 directory, compiled against the 3.5 framework.

I get this result when I Build the project; however, when I Rebuild the project, the same is true with the exception that the dll in the bin\Release directory is missing. The other 3 files (pdb in Release and dll and pdb in Release3.5) are still there and have the correct modified date.

Any help would greatly appreciated.

Edit:
After some help, it looks like it works fine when I run MSBuild from the command line, but when I am running the build through Visual Studio, that is when I get the problem I described above.

Edit2:
Verbose output from Visual Studio with Rebuild command in release mode. I was only able to post “Normal” output, and not “Detailed” or “Diagnostics” due to the length. I did look through those, and I didn’t see any steps for deleting Args.dll from the regular release directory AFTER it had been compiled and copied from obj to bin (there was a delete step before the compile, but I would expect that).

------ Rebuild All started: Project: Args, Configuration: Release Any CPU ------
Build started 2/15/2011 8:23:57 AM.
CoreClean:
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\bin\Release\Args.dll".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\bin\Release\Args.pdb".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release\Args.Properties.Resources.resources".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release\GenerateResource.read.1.tlog".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release\GenerateResource.write.1.tlog".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release\Args.dll".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release\Args.pdb".
CoreResGen:
  "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /compile Properties\Resources.resx,obj\Release\Args.Properties.Resources.resources
  Processing resource file "Properties\Resources.resx" into "obj\Release\Args.Properties.Resources.resources".
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\Args.dll /resource:obj\Release\Args.Properties.Resources.resources /target:library Args.cs ArgumentDefinition.cs ArgumentParser.cs Configuration.cs IInitializeModelBindingStrategy.cs ModelBindingStrategy.cs DefaultModelBinder.cs IArgsTypeConverter.cs IArgumentParser.cs IModelBinder.cs InternalExtenstions.cs InvalidArgsFormatException.cs InvalidModelDefinitionException.cs LambdaArgsTypeConverter.cs ModelBinders.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs "C:\Users\Brian\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cs"
CopyFilesToOutputDirectory:
  Copying file from "obj\Release\Args.dll" to "bin\Release\Args.dll".
  Args -> C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\bin\Release\Args.dll
  Copying file from "obj\Release\Args.pdb" to "bin\Release\Args.pdb".
CoreClean:
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\bin\Release3.5\Args.dll".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\bin\Release3.5\Args.pdb".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release35\Args.Properties.Resources.resources".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release35\ResGen.read.1.tlog".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release35\ResGen.write.1.tlog".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release35\Args.dll".
  Deleting file "C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\obj\Release35\Args.pdb".
CoreResGen:
  C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64\Tracker.exe @"C:\Users\Brian\AppData\Local\Temp\e35fa3c4055b4fd18515148e01c79912.tmp"  /c "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ResGen.exe" /useSourcePath /r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /compile Properties\Resources.resx,obj\Release35\Args.Properties.Resources.resources 
CoreCompile:
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release35\Args.dll /resource:obj\Release35\Args.Properties.Resources.resources /target:library Args.cs ArgumentDefinition.cs ArgumentParser.cs Configuration.cs IInitializeModelBindingStrategy.cs ModelBindingStrategy.cs DefaultModelBinder.cs IArgsTypeConverter.cs IArgumentParser.cs IModelBinder.cs InternalExtenstions.cs InvalidArgsFormatException.cs InvalidModelDefinitionException.cs LambdaArgsTypeConverter.cs ModelBinders.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs
CopyFilesToOutputDirectory:
  Copying file from "obj\Release35\Args.dll" to "bin\Release3.5\Args.dll".
  Args -> C:\Users\Brian\Documents\Visual Studio 2010\Projects\Args\Args\bin\Release3.5\Args.dll
  Copying file from "obj\Release35\Args.pdb" to "bin\Release3.5\Args.pdb".

Build succeeded.

Time Elapsed 00:00:00.98
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:23:22+00:00Added an answer on May 20, 2026 at 3:23 am

    Why

    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 
    

    is under main PropertyGroup and not just under conditions
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    and <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> ?

    Hmmm…
    What happens if you add a command like

    <Exec Command="attrib +r $(TargetPath)"/>
    

    to AfterBuild, PreBuildEvent or BeforeBuild ?
    (Where TargetPath should be the dll file…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

MSBuild 3.5 I have the following project structure: trunk/MainSolution.sln trunk/Build/MyBuild.Proj trunk/Library/... trunk/etc... So far,
I have following text in a file 23456789 When I tried to replace the
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following string String str = replace :) :) with some other string;
I have following foreach-loop: using System.IO; //... if (Directory.Exists(path)) { foreach(string strFile in Directory.GetFiles(path,
I have following situation. A main table and many other tables linked together with
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following Code Block Which I tried to optimize in the Optimized section
I have following classes. class A { public: void fun(); } class B: public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.