If you take a closer look at the error you will notice that it tries to copy some files from the Debug folder rather than the Release one. Deploy.bat builds NopCommerce solution in Release, so if you haven't built the solution in Debug you will get this error as this files will be missing as you don't have any Debug folders at all. The right solution is to pass the current configuration as a parameter when publishing Nop.Web and Nop.Admin projects in nop.proj file.
Open your build\nop.proj file and change it with the following. Note: The changes are in BOLD
I've still yet to get Deploy.bat (or Prepare.bat) to work on my PC. I've resorted to publish from VS and created a batch file to copy Plugins, but I'd really like to use Deploy.bat. Can anyone provide any insight into these errors or some other ??
First, I set the Configuration in VS to Release Any CPU, and do a build. Then exit VS and I try to run Deploy.bat
"C:\Users\Dennis\Documents\Visual Studio 2010\Projects\nopCommerce2\src\ build\nop.proj" (Deploy target) (1) -> "C:\Users\Dennis\Documents\Visual Studio 2010\Projects\nopCommerce2\src\ NopCommerce.sln" (default target) (2) -> (ValidateSolutionConfiguration target) -> C:\Users\Dennis\Documents\Visual Studio 2010\Projects\nopCommerce2\src \NopCommerce.sln.metaproj : error MSB4126: The specified solution config uration "Release|HPD" is invalid. Please specify a valid solution config uration using the Configuration and Platform properties (e.g. MSBuild.ex e Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave th ose properties blank to use the default solution configuration. [C:\User s\Dennis\Documents\Visual Studio 2010\Projects\nopCommerce2\src\NopComme rce.sln]
If I modify build.bat and add these switches to the MSBuild line, the build looks like it gets near to the end before failing:
"C:\Users\Dennis\Documents\Visual Studio 2010\Projects\nopCommerce2\src\ build\nop.proj" (Deploy target) (1) -> "C:\Users\Dennis\Documents\Visual Studio 2010\Projects\nopCommerce2\src\ Presentation\Nop.Web\Nop.Web.csproj" (ResolveReferences;_CopyWebApplicat ion target) (28:2) -> (_CheckForInvalidConfigurationAndPlatform target) -> C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (483,9): error : The OutputPath property is not set for project 'Nop.Web .csproj'. Please check to make sure that you have specified a valid com bination of Configuration and Platform for this project. Configuration= 'Release' Platform='Any CPU'. You may be seeing this message because y ou are trying to build a project without a solution file, and have speci fied a non-default Configuration or Platform that doesn't exist for this project. [C:\Users\Dennis\Documents\Visual Studio 2010\Projects\nopComm erce2\src\Presentation\Nop.Web\Nop.Web.csproj]
"C:\Users\D\Documents\Visual Studio 2010\Projects\nopCommerce2\src\ build\nop.proj" (Deploy target) (1) -> "C:\Users\D\Documents\Visual Studio 2010\Projects\nopCommerce2\src\ Presentation\Nop.Web\Nop.Web.csproj" (ResolveReferences;_CopyWebApplicat ion target) (29:2) -> (_CopyWebApplicationLegacy target) -> C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplica tions\Microsoft.WebApplication.targets(132,5): error MSB3021: Unable to copy file "obj\Any CPU\Release\Nop.Web.dll" to "C:\Users\D\Document s\Visual Studio 2010\Projects\nopCommerce2\src\build\..\Deployable\nop_2 .1\\bin\Nop.Web.dll". Could not find file 'obj\Any CPU\Release\Nop.Web.d ll'. [C:\Users\D\Documents\Visual Studio 2010\Projects\nopCommerce2 \src\Presentation\Nop.Web\Nop.Web.csproj]
I've also tried VS Debug configuration with similar results. Also tried "AnyCPU" with no space, and got error similar to first case above ... "Release|AnyCPU" is invalid. Please specify a valid ...
Well this is a year old and maybe you found a solution already. I experienced the same message. My solution was to add <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Any CPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <Prefer32Bit>false</Prefer32Bit> </PropertyGroup>
Onto all projects where MSBuild demanded it, because now its searching a configuration "Any CPU" and in the project files its named "AnyCPU".
Now the bat files work fine but
this resulted in Nop.Web and Nop.Admin complied dll files not being copied to the deploy folder anymore, because of the setting "Any CPU" MSBuild is looking into the wrong output-folder and therefor the built files are not copied. which I guess I need to correct here (not tested yet): <!--Now lets publish Nop.Admin--> <MSBuild Projects="$(RootFolder)\Presentation\Nop.Web\Administration\Nop.Admin.csproj" Targets="ResolveReferences;_CopyWebApplication" Properties="WebProjectOutputDir=$(DeployFolder)\$(DeployPrefix)\Administration\; OutDir=$(DeployFolder)\$(DeployPrefix)\Administration\bin\;Configuration=$(Configuration)" />
What I don't understand is, why this same deploy procedure with EXACT the same project files works on our server without changing the build.bat file?!?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.