-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property definition that impacts generated AssemblyInfo doesn't support CData #1294
Comments
This works in MSBuild 14, but fails in MSBuild 15. |
@NTaylorMullen I tried both .netcore and full framework msbuild and they both seem to work. Can you please paste in a full repro project that fails for you, as well as the output from Here's the project that I tested on: <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Description><![CDATA[
<Target Name="Build">
<ItemGroup>
<foo Remove=""/>
</ItemGroup>
<Message Text="-@(foo)-"/>
</Target>]]></Description>
<p><![CDATA[Line 1
Line 2
Line 3]]></p>
</PropertyGroup>
<ItemGroup>
<i Include="a">
<m><![CDATA[Line 1
Line 2
Line 3]]></m>
</i>
</ItemGroup>
<Target Name="Build">
<Message Text="$(Description)" Importance="High"/>
<Message Text="$(p)" Importance="High"/>
<Message Text="@(i->'%(m)')" Importance="High"/>
</Target>
</Project> |
Project File (from <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
<Description><![CDATA[Line 1
Line 2
Line 3]]></Description>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App">
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Sdk">
<Version>1.0.0-alpha-20161104-2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> Then trying to run results in this:
On closer inspection it looks like the system is generating the msbuild assembly info file incorrectly. It looks like: // Generated by the MSBuild WriteCodeFragment class.
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("msbuild")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("Line 1
Line 2
Line 3")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("msbuild")]
[assembly: System.Reflection.AssemblyTitleAttribute("msbuild")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Resources.NeutralResourcesLanguageAttribute("en")] Lastly msbuild version is
@rainersigwald must have also tested a property that impacts the assembly info. I've updated the title. |
OK, I can also replicate the bad syntax in the generated AssemblyInfo. What about the parsing CDATA error inside the actual msbuild file? Is that still an issue for you? If yes, can you please post the project file? |
CodeDom is not not available on .net core, so copy over its string quoting implementation. Ideally, all this code should be replaced with crossplatform Roselyn Fixes dotnet#1294
CodeDom is not available on .net core, so copy over its string quoting implementation. Ideally, all this code should be replaced with crossplatform Roselyn Fixes dotnet#1294
CodeDom is not available on .net core, so copy over its string quoting implementation. Ideally, all this code should be replaced with crossplatform Roselyn Fixes dotnet#1294
CodeDom is not available on .net core, so copy over its string quoting implementation. Ideally, all this code should be replaced with crossplatform Roselyn Fixes dotnet#1294
* Mimic Full Framework string quoting CodeDom is not available on .net core, so copy over its string quoting implementation. Ideally, all this code should be replaced with crossplatform Roselyn Fixes #1294
From @NTaylorMullen on November 1, 2016 18:30
Adding a
<Description>
to my csproj that looks like:Results in the following error when trying to build:
Copied from original issue: dotnet/sdk#347
The text was updated successfully, but these errors were encountered: