ikvmnet / ikvm

A Java Virtual Machine and Bytecode-to-IL Converter for .NET
Other
1.15k stars 109 forks source link

The "IkvmReferenceItemPrepare" task was not given a value for the required parameter "ToolFramework". #511

Closed jaime-trejo closed 2 months ago

jaime-trejo commented 2 months ago

I'm getting the following error "The "IkvmReferenceItemPrepare" task was not given a value for the required parameter "ToolFramework"." after adding the following to my .csproj

I am running the project in .Net Framework 4.8

  <ItemGroup>
    <PackageReference Include="IKVM" Version="8.7.6" />
  </ItemGroup>
  <ItemGroup>
    <IkvmReference Include="lib\helloworld-2.0.jar" />
  </ItemGroup>

and the following since it seems I had to add one

  <Target Name="ResolvePackageDependenciesForBuild">
    <Error Condition="!Exists('lib\helloworld-2.0.jar')" Text="$([System.String]::Format('$(ErrorText)', 'lib\helloworld-2.0.jar'))" />
  </Target>

Not sure if I'm missing something. Basically I'm starting a project from scratch to see if it works because i couldn't build successfully on a previous project of ikvm 7.

Any help will be appreciated.

wasabii commented 2 months ago

This sounds like an incorrect target framework. What is the target framework you are trying to build with?

jaime-trejo commented 2 months ago

I'm building towards .NET 4.8

Example of the beginning of the .csproj

<?xml version="1.0" encoding="utf-8"?>
<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')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{626B091B-4D5E-47A3-B184-8B0B2592BF0E}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Hello</RootNamespace>
    <AssemblyName>Hello</AssemblyName>
    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <TargetFrameworkProfile />
    <NuGetPackageImportStamp>
    </NuGetPackageImportStamp>
  </PropertyGroup>
wasabii commented 2 months ago

This doesn't look like an SDK style project. We only support SDK style projects.

jaime-trejo commented 2 months ago

Thanks! Appreciate it.