Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
416 views
in Technique[技术] by (71.8m points)

asp.net - "Can't find the valid AspnetMergePath" on Visual Web Developer Publish?

I am wanting to use Visual Web Developer Express 2010 to publish a website, pre-compiled to a remote server over FTP using the following settings:

  • Deploy only files needed to run this application
  • Precompile this application before publishing
  • Allow website to be updatable
  • No databases are being deployed
  • Site is being deployed as file hierarchy, not as .zip package

My first build/deploy seemed to have gone well, but after my second compilation I receive the following error:

Transformed web.config using C:path_to_siteWeb.Debug.config into objDebugTransformWebConfigransformedweb.config.
Copying all files to temporary location below for package/publish:
objDebugAspnetCompileMergeSource.
C:Program Files (x86)MSBuildMicrosoftVisualStudiov10.5WebTransformMicrosoft.Web.Publishing.AspNetCompileMerge.targets(132,5): Error : Can't find the valid AspnetMergePath

And here's a subset of the content of the Microsoft.Web.Publishing.AspNetConfigurationMerge.targets file:

  <Target
      Name="GetAspNetMergePath"
      DependsOnTargets="$(GetAspNetMergePathDependsOn)"
      Condition ="'$(GetAspNetMergePath)' != 'false'">
    <PropertyGroup>
      <AspnetMergeName>aspnet_merge.exe</AspnetMergeName>
      <AspnetMergePath Condition="Exists('$(TargetFrameworkSDKToolsDirectory)$(AspnetMergeName)')">$(TargetFrameworkSDKToolsDirectory)</AspnetMergePath>
    </PropertyGroup>
    <Error Condition="'$(AspnetMergePath)' == '' Or !Exists($(AspnetMergePath))"
           Text="Can't find the valid AspnetMergePath" />
  </Target>

EDIT: Changing the publish settings to delete all existing files before publishing does not fix the problem after all. I'm assuming that the problem is local for now because of this.

There does not appear to be an AspMergePath tag in my web.config. I am not aware if I am supposed to manually add the tag. However, the path "obj{publish setting}AspnetCompileMergeSource" does exist in my project.

And in case it matters, my project name is "TestProject.NET"

Your feedback is appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I hit the same problem. Searched through all microsoft related sites, found a lot of complaints and no intention from microsoft to fix it.

Here how I worked it around at my system. Edit the Microsoft.Web.Publishing.AspNetConfigurationMerge.targets file and add the following line. Please make sure that the Microsoft SDK path is the same on your PC, if not then change it:

<TargetFrameworkSDKToolsDirectory>C:Program Files (x86)Microsoft SDKsWindowsv7.0ABin</TargetFrameworkSDKToolsDirectory>

Here is how it should look like:

  <Target
  Name="GetAspNetMergePath"
  DependsOnTargets="$(GetAspNetMergePathDependsOn)"
  Condition ="'$(GetAspNetMergePath)' != 'false'">
<PropertyGroup>
  <TargetFrameworkSDKToolsDirectory>C:Program Files (x86)Microsoft SDKsWindowsv7.0ABin</TargetFrameworkSDKToolsDirectory>
  <AspnetMergeName>aspnet_merge.exe</AspnetMergeName>
  <AspnetMergePath Condition="Exists('$(TargetFrameworkSDKToolsDirectory)$(AspnetMergeName)')">$(TargetFrameworkSDKToolsDirectory)</AspnetMergePath>
</PropertyGroup>
<Error Condition="'$(AspnetMergePath)' == '' Or !Exists($(AspnetMergePath))"
       Text="Can't find the valid AspnetMergePath" />


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...