Skip to content
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

Cannot create AssemblyInfo for CodeLanguage="CPP" #233

Open
KerstinKeller opened this issue Aug 12, 2016 · 2 comments · May be fixed by #295
Open

Cannot create AssemblyInfo for CodeLanguage="CPP" #233

KerstinKeller opened this issue Aug 12, 2016 · 2 comments · May be fixed by #295

Comments

@KerstinKeller
Copy link

I have installed msbuildtasks for Visual Studio 2015 and want to create the AssemblyInfo.cpp file for my C++/CLI project.

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Target Name="Version">
    <AssemblyInfo
        CodeLanguage="CPP"
        OutputFile="..\src\AssemblyInfo.cpp"
        AssemblyTitle="project"
        AssemblyDescription="project"
        AssemblyCompany="project"
        AssemblyProduct="project"
        AssemblyCopyright="Copyright"
        ComVisible="false"
        CLSCompliant="true"
        AssemblyInformationalVersion="v1.0.0"
        AssemblyVersion="1.0.0"
       AssemblyFileVersion="1.0.0" />
  </Target> 
</Project>

However, when running the task I get the output:

1>D:\xxx.targets(4,5): error : The C++/CLI code provider wasn't found. Make sure you have Visual C++ installed.
1>D:\xxx.targets(4,5): error MSB4018: The "AssemblyInfo" task failed unexpectedly.
1>D:\xxx..targets(4,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
1>D:\xxx.targets(4,5): error MSB4018: at MSBuild.Community.Tasks.AssemblyInfo.GenerateFile(TextWriter writer)
1>D:\xxx..targets(4,5): error MSB4018: at MSBuild.Community.Tasks.AssemblyInfo.Execute()
1>D:\xxx..targets(4,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>D:\xxx..targets(4,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

I have added CppCodeProvider to my projects references, however, that has not helped.
From the sources (https://github.com/loresoft/msbuildtasks/blob/master/Source/MSBuild.Community.Tasks/AssemblyInfo.cs) it seems that AssemblyInfo task is looking for CppCodeProvider '8.0.0.0', however for the project references I can only pick version '10.0.0.0'

What is the proper way to include the CppCodeProvider or is this a bug?

@ybeapps
Copy link

ybeapps commented Jun 25, 2018

I have the same problem... take a look at this:
private const string CppCodeProviderAssembly = "CppCodeProvider, "+
"Version=8.0.0.0, " +
"Culture=neutral, " +
"PublicKeyToken=b03f5f7f11d50a3a, " +
"processorArchitecture=MSIL";

jmairboeck added a commit to jmairboeck/msbuildtasks that referenced this issue Jun 2, 2020
… the version provided at least in Visual Studio 2017 and 2019)

fixes loresoft#233
@Eruvisu
Copy link

Eruvisu commented Jan 20, 2021

I also have this problem.
Can we get an update about the pull request that has been created by @jmairboeck?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants