Jump to content
RAGE Multiplayer Community

Compiler doesn't include Microsoft.CSharp.dll


Recommended Posts

Hello everyone,

After I updated my server to 1.1.0-DP1-2 and converted my C# Code to that version, I got an error in console telling me:

-> Starting RageZ resource..
RageZ: loading scripts.. found 6 script(s)
RageZ: reading referenced assemblies.. found 7 reference(s)
RageZ: compiling scripts..
/scripts/World.cs(24,28): error CS0656: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.Convert'
CS0656: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.Convert'
       -> /scripts/World.cs:23


Value cannot be null. (Parameter 'source')
-> Error starting RageZ due compilation error(s).
Exception message: Value cannot be null. (Parameter 'source')

And part of the World.cs:
 

23: {
24:         int sec = NAPI.Data.GetWorldData("second");
25:         int min = NAPI.Data.GetWorldData("minute");
26:         int hr = NAPI.Data.GetWorldData("hour");

It looks like it has problems converting it from dynamic into int. the return value of this method is dynamic:
 

public dynamic GetWorldData(string key);

But the Microsoft.Csharp.dll is in my Nuget dependencies and also as dll in my dependecies folder:
 

17:         <assembly ref="/dependencies/Microsoft.CSharp.dll"/>
18:
19:         </meta>

I didn't have that problem before I upgraded to 1.1.0-DP1-2.
 

I hope you guys can figure it out
I thank you in advance :)

Link to post
Share on other sites

Hey,

thanks for the reply. Yes it is a NET Core Class Libary Porject.
Normally I won't put it in my meta.xml but I thought that could be a workaround.
The Problem is that before 1.1 it worked properly. That's why I'm wondering.

Link to post
Share on other sites

Yes, Xabi thats right, but I think this is not the problem. It's inside since Version 1.0 and a elemtary core function.

docs.microsoft.com/de-de/dotnet/csharp/programming-guide/types/using-type-dynamic

xdaniel00x can you post your Project Setup please. So the csproj file. In my case it's look like

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
	<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
	<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <RootNamespace>Test-Server</RootNamespace>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <PlatformTarget>x64</PlatformTarget>
    <OutputPath>F:\Games\RAGEMP\server-files\dotnet\resources\roleplay\</OutputPath>
  </PropertyGroup>

  <ItemGroup>
    <Reference Include="Bootstrapper">
      <HintPath>F:\Games\RAGEMP\server-files\dotnet\runtime\Bootstrapper.dll</HintPath>
	  <Private>false</Private>
    </Reference>
    <Reference Include="Newtonsoft.Json">
      <HintPath>F:\Games\RAGEMP\server-files\dotnet\runtime\Newtonsoft.Json.dll</HintPath>
	  <Private>false</Private>
    </Reference>
  </ItemGroup>

</Project>

the next intresting think is the meta.xml... in my case

meta
 script src="roleplay.dll" /> 
 	info name="RageMpSandbox" type="gamemode" description="metadescription"
meta

Next.... which folder you are using???

    - bridge
    - dotnet

This was changed too, from 0.3.7 to 1.1

And...what do you mean with

Zitat

converted my C# Code

Do you upgraded it... so included all the changes like Client to Player or API to NAPI?? or mean this you used a script/program to do this?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...