element is invalid. The "path" parameter cannot have a zero length. F # I get t...">

Error MSB4102: The value of the "Project attribute" in the <Import> element is invalid. The "path" parameter cannot have a zero length. F #

I get the following error when creating a project in a city team.

The same project is built on a local machine. The local computer has VS 2015 and F # 4.0.

My project configuration is as follows.

<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Choose> <When Condition="'$(VisualStudioVersion)' == '11.0'"> <PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.0\Framework\v4.0\Microsoft.FSharp.Targets')"> <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath> </PropertyGroup> </When> <Otherwise> <PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')"> <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath> </PropertyGroup> </Otherwise> </Choose> <Import Project="$(FSharpTargetsPath)" /> 

This is a console application.

+6
source share
1 answer

I had a similar problem a while ago because I was running a local machine with administrator privileges, but the Visual Studio installer set the environment variables at the user level, and not at the system level that the administrator uses. Therefore, when compiling as an administrator, FSharpTargetsPath not built correctly from environment variables such as VisualStudioVersion .

Look on your local computer to find out what values โ€‹โ€‹of environment variables are set for VisualStudioVersion at the level that you are successfully using (system or user), as well as other variables, and then make sure that they are set at the appropriate level on the Team City machine.

You may be working as user on your local computer and system on a Team City machine.

Read more here: fooobar.com/questions/20042 / ...

Hope this makes sense.

+5
source

All Articles