Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Update to new MSBuild format in project files, for Netstandard2.0 #169

Merged
merged 5 commits into from
Dec 16, 2021

Conversation

mikkeljohnsen
Copy link
Contributor

Updating project files for the new MSBuild format.

Changing to build for netstandard2.0.

Since netstandard do not af Domains I had to remove that. Also had to change for TypeBuilder. Not sure what that does.

@dnfadmin
Copy link

dnfadmin commented Jan 24, 2021

CLA assistant check
All CLA requirements met.

Comment on lines -190 to +182
tb.CreateType();
ab.SetEntryPoint (fb, PEFileKinds.WindowApplication);
ab.Save (file);
return fullFile;
tb.CreateTypeInfo();
return tb.FullName;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this ?
Will the change do the same. I have no idea what it is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's basically the path to the executable that would be written by the above code.

That means the code that does the running of the saved assembly:
https://github.com/mono/mono-addins/pull/169/files#diff-c7001386acf361c301b4a1e3d0da4fb27fb5e7d6396ba081583caf2e34b805fbR74

Should be modified to handle this scenario.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have it running and is working in my case. When is this used ?

I'm not sure if that is possible in netstandard !!

I will have to investigate more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anyone who have an idea, on how to solve this in netstandard ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikkeljohnsen one solution would be to make a separate project that contains the emitted code and run it from an assembly on disk that's shipped with Mono.Addins. In example, Mono.Addins.Setup.exe could be the one, it calls SetupProcess.Main

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code does not seem to work. The generated exe needs to have the Mono.Addins.dll copied into its directory otherwise it does not work.

Also not sure why an exe needs to be generated on the fly here - maybe I am missing something. Seems like a pre-built executable could be used since all the generated code does it call into SetupProcess.Main. Which currently does not work since SetupProcess is an internal class.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…project file. When reverted back to internal on functions/classes
…References.cs.

Removed dependencies for Mono.Addins.MSBuild on Mono.Addins.Setup. Not needed
@@ -52,5 +49,4 @@
<Name>SecondAssembly</Name>
</ProjectReference>
</ItemGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get this to compile I had to add some remove items. Otherwise I get errors about duplicate assembly attributes.

  <ItemGroup>
    <None Remove="OptionalModule\**" />
    <None Remove="SecondAssembly\**" />
    <Compile Remove="OptionalModule\**" />
    <Compile Remove="SecondAssembly\**" />
  </ItemGroup>

@mrward mrward mentioned this pull request Feb 9, 2021
8 tasks
@mrward
Copy link
Member

mrward commented Feb 9, 2021

OK - took this branch and added some extra changes on another branch/PR - #171 - mainly wanted to get the tests passing. Still some things that I think need looking at. Added as a TODO on the other PR.

Base automatically changed from master to main March 9, 2021 14:16
@sandyarmstrong sandyarmstrong merged commit 7a14e93 into mono:main Dec 16, 2021
@mikkeljohnsen mikkeljohnsen deleted the netstandard2.0 branch December 16, 2021 21:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants