Создать чистый проект FNA XNA: ошибка: значение не может быть нулевым. Имя параметра: тип - PullRequest
3 голосов
/ 28 апреля 2020

Я начал изучать XNA с F #. Чтобы сослаться на проект конвейера контента, мне нужен проект XNA, но когда я пытаюсь вставить GUID типа проекта XNA в проект F #, я получаю следующую ошибку:

.fsproj : error  : Value cannot be null. Parameter name: type

Я знаю, что XNA не поддерживает F # и что ошибки могут появиться с этой неожиданной комбинацией. Перед созданием библиотеки XNA я хотел узнать, есть ли обходной путь для преобразования моего проекта F #. Создание библиотеки XNA не особенно сложно. Где в этом проблема?

Дополнительная информация:

Я использую Visual Studio 2019. Для использования VS19 с XNA: http://flatredball.com/visual-studio-2019-xna-setup/

Мой полный fsproj:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.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)' == '' ">x86</Platform>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>f8ccb76d-60a3-421b-828e-d8538c75b0ba</ProjectGuid>
    <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Craftsoft</RootNamespace>
    <AssemblyName>Craftsoft</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <LangVersion>preview</LangVersion>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <UseStandardResourceNames>true</UseStandardResourceNames>
    <WarningsAsErrors>3239;$(WarningsAsErrors)</WarningsAsErrors>
    <Name>Craftsoft</Name>
    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
    <XnaPlatform>Windows</XnaPlatform>
    <XnaProfile>HiDef</XnaProfile>
    <XnaCrossPlatformGroupID>5f5b4b11-54a2-428f-930c-c782543c4692</XnaCrossPlatformGroupID>
    <XnaOutputType>Game</XnaOutputType>
    <ApplicationIcon>Game.ico</ApplicationIcon>
    <Thumbnail>GameThumbnail.png</Thumbnail>
  </PropertyGroup>
  <PropertyGroup>
    <MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets') ">
    <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <Tailcalls>false</Tailcalls>
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
    <WarningLevel>3</WarningLevel>
    <DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
    <NoStdLib>true</NoStdLib>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <PlatformTarget>x86</PlatformTarget>
    <XnaCompressContent>false</XnaCompressContent>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <Tailcalls>true</Tailcalls>
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <DefineConstants>TRACE;WINDOWS</DefineConstants>
    <WarningLevel>3</WarningLevel>
    <DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
    <NoStdLib>true</NoStdLib>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <PlatformTarget>x86</PlatformTarget>
    <XnaCompressContent>true</XnaCompressContent>
  </PropertyGroup>
  <Import Project="$(FSharpTargetsPath)" />
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
  <ItemGroup>
    <Compile Include="Properties\AssemblyInfo.fs" />
    <Content Include="Content\*.xnb">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Compile Include="Game1.fs" />
    <Compile Include="Program.fs" />
    <Content Include="App.config" />
    <Content Include="packages.config" />
    <Content Include="Game.ico" />
    <Content Include="GameThumbnail.png">
      <XnaPlatformSpecific>true</XnaPlatformSpecific>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <Reference Include="FSharp.Core">
      <HintPath>..\packages\FSharp.Core.net40.4.7.1\lib\net40\FSharp.Core.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
    <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
    <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
    <Reference Include="Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
    <Reference Include="System" />
    <Reference Include="System.Net" />
    <Reference Include="System.Numerics" />
    <Reference Include="System.ValueTuple">
      <HintPath>..\packages\System.ValueTuple.4.5.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll</HintPath>
    </Reference>
  </ItemGroup>
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
...