Skip to content

Cannot compile with Visual Studio 2017 #96

@Galad

Description

@Galad

Hello,
Compiling with Visual Studio 2017 produces an error in the output window:

The "GenerateCodeFromAttributes" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Le fichier spécifié est introuvable.
File name: 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
   at CodeGeneration.Roslyn.Tasks.GenerateCodeFromAttributes.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

I updated the CodeGeneration.Roslyn package. Now another error is returned when compiling:

The "GenerateCodeFromAttributes" task failed unexpectedly.
System.ArgumentException: Object type cannot be converted to target type.
   at CodeGeneration.Roslyn.Tasks.Helper.set_Compile(ITaskItem[] value)
   at CodeGeneration.Roslyn.Tasks.GenerateCodeFromAttributes.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

Code generation at design time does not work either.
I imagine it has to do with CodeGeneration.Roslyn moving to dotnet standard instead portable. It is probably related to #87

Using Visual Studio 2017 Professional.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions