Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot configure solution that contains a .Net Core project #56

Closed
TheLastRar opened this issue Nov 13, 2017 · 14 comments
Closed

Cannot configure solution that contains a .Net Core project #56

TheLastRar opened this issue Nov 13, 2017 · 14 comments
Milestone

Comments

@TheLastRar
Copy link

How to reproduce

Create a solution with a .Net Core library

What version and selected configuration ?

v1.6.0b3

Can you provide detailed log of your build ?

When running DllExport_configure.bat

[03:11:55 PM.9349] [Fatal] ERROR-Wizard: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. D:\Air\Source\Repos\CLR-DEV9\CLR_DEV9\CLR_DEV9_CORE.csproj

@3F
Copy link
Owner

3F commented Nov 13, 2017

Thanks for the report.

The problem because of new SDK-based format of project files and old MS-logic.

That is, this part controlled by MvsSln project, and this exactly from Microsoft.Build.Evaluation-classes. As I understand, today MS don't want to support many incompatible changes (like this 3F/MvsSln#1) at least for .net 4.0...

But, this is not a big problem for DllExport project at least for current features :)

Before fixes, temporarily try to use this by adding xmlns="http://schemas.microsoft.com/developer/msbuild/2003" attr, for example:

<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>
</Project>

@TheLastRar
Copy link
Author

TheLastRar commented Nov 14, 2017

It now complains about the Remove attribute in element <Compile> being unrecognizable.
Below is the containing item group

<ItemGroup>
    <Compile Remove="obj_netfx\**" />
    <EmbeddedResource Remove="obj_netfx\**" />
    <None Remove="obj_netfx\**" />
</ItemGroup>

It also complains about the Version attribute in element <PackageReference>

Temporarily removing theses attributes, in addition to your suggestion, allows the configuration tool to run, allowing me to add it to both netfx and netcore projects (although the netcore won't build, complaining that it can't find ildasm.exe (using default IL Assembler)).

@3F
Copy link
Owner

3F commented Nov 14, 2017

well yes, because of obsolete schema.

it can't find ildasm.exe

Can you clarify this part in details ? Currently DllExport still have no official support for .net core projects if you're trying this. But if you have problem for others, please send detailed build log.

@TheLastRar
Copy link
Author

This is on a .Net Core project, when attempting to build, there is an error stating it can't find ildasm.exe

The relevant part of the log;

1>Target DllExportMod:
1>  Using "DllExportAppDomainIsolatedTask" task from assembly "D:\Air\Source\Repos\CLR-DEV9 - Copy\packages\DllExport.1.6.0-beta3\tools\RGiesecke.DllExport.MSBuild.dll".
1>  Task "DllExportAppDomainIsolatedTask"
1>    Cannot find lib.exe in 'D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\bin'.
1>    D:\Air\Source\Repos\CLR-DEV9 - Copy\packages\DllExport.1.6.0-beta3\tools\net.r_eg.DllExport.targets(56,5): error : Microsoft.Build.Utilities.ToolLocationHelper could not find ildasm.exe.
1>  Done executing task "DllExportAppDomainIsolatedTask" -- FAILED.
1>Done building target "DllExportMod" in project "CLR_DEV9_CORE.csproj" -- FAILED.

If you want the full log I can also attach it (it's quite long).

@3F
Copy link
Owner

3F commented Nov 15, 2017

yes, please attach the full detailed log as an additional file using the following command:

msbuild <YourSlnFile> /t:Rebuild /m:4 /v:diag > build.log

@TheLastRar
Copy link
Author

https://we.tl/LX7hwZTwrk

The Solution has 4 projects
CLR_DEV9 is the main project and is a .netfx project
CLR_DEV9_CORE is the same project, but configured as a .netcore project
DNS Test Thing & UPNP Test Thing are test projects and do not use DllExport (and are both .netfx projects).

The solution file had C++ (Linux) projects, but those where removed to install v1.6.0 (and never readded)

@3F
Copy link
Owner

3F commented Nov 15, 2017

Something went wrong with your configuration because I see calling DllExportMod for both projects "CLR_DEV9.csproj" & "CLR_DEV9_CORE.csproj" (.NETCoreApp,Version=v2.0)

4>Target "DllExportMod: (TargetId:77)" 
in file "D:\Air\Source\Repos\CLR-DEV9 - Copy\packages\DllExport.1.6.0-beta3\tools\net.r_eg.DllExport.targets" 
from project "D:\Air\Source\Repos\CLR-DEV9 - Copy\CLR_DEV9\CLR_DEV9.csproj" (target "PostBuildEvent" depends on it):
5>Target "DllExportMod: (TargetId:86)" 
in file "D:\Air\Source\Repos\CLR-DEV9 - Copy\packages\DllExport.1.6.0-beta3\tools\net.r_eg.DllExport.targets" 
from project "D:\Air\Source\Repos\CLR-DEV9 - Copy\CLR_DEV9\CLR_DEV9_CORE.csproj" (target "PostBuildEvent" depends on it):

Can you try to reconfigure all this again by removing from all projects (uncheck for all - then apply - then again install for CLR_DEV9.csproj), and also choose '.targets file' storage (.net.dllexport.targets). I still can't reproduce this error even if .net core-based project has dependencies to projects with DllExport modification. In addition, you also may reproduce this structure of projects as an simple demo, then attach for debug.

p.s.: please attach anything (including text-based log above) as zip archive etc. still via github attachments.

@TheLastRar
Copy link
Author

The configuration was intentional, I was wanting to see if DllExport export worked with .Net Core projects (It didn't).

The solution builds correctly if DllExport is removed from CLR_DEV9_CORE and only configured for CLR_DEV9.

I mentioned before that the two projects are effectively the same, CLR_DEV9 is intended for windows users and CLR_DEV9_CORE is the Linux port (hence the need for CoreCLR), the builds are not dependent on each other.

If DllExport does not support .NetCore, then I will have to create a wrapper for the .NetCore version of the project.

@3F
Copy link
Owner

3F commented Nov 15, 2017

The solution builds correctly if DllExport is removed from CLR_DEV9_CORE and only configured for CLR_DEV9.

Good ! as I expected.


Just to be clear for all, again, this repo does not contain support for .net core-based projects today.

@3F
Copy link
Owner

3F commented Nov 17, 2017

@TheLastRar please check the latest changes - build70 ( 20eb9db )

dxpinternalerrormsg

@TheLastRar
Copy link
Author

The new bat file failed with

'a4' is not recognized as an internal or external command,
operable program or batch file.
MSBuild tools was not found. Try with `-msb` key. `-help` for details.

If i use the old bat file, but keep the files in DllExport.1.6.0-beta3 as build70, the configuration tool launches correctly, detecting the Core and C++ projects as unload-able and allows me to configure the framework project (CLR_DEV9).

I uninstalled and reinstalled DllExport to check if that works and builds (it does).

@3F
Copy link
Owner

3F commented Nov 17, 2017

Thanks for the reply ! Seems problem for LF from AppVeyor CI

Please check new build71 (same commit) with:

git config --global core.autocrlf true

https://ci.appveyor.com/project/3Fs/dllexport/build/build-71

Related issue: 3F/hMSBuild#2

@TheLastRar
Copy link
Author

Yes that version works correctly

@3F 3F added this to the v1.6 milestone Nov 18, 2017
@3F
Copy link
Owner

3F commented Nov 18, 2017

Good ! v1.6 will be soon. Anyone else, please test latest beta as carefully as possible.

@3F 3F closed this as completed Nov 18, 2017
3F added a commit that referenced this issue Nov 26, 2017
* FIXED: Avoids crashes when project cannot be loaded for some reasons. Issue #56
* FIXED: Fixed usage of manager outside the Solution directory.
* FIXED: Fixed restoring package when using `-pe-exp-list` command.
* NEW: Added `-mgr-up` key. Will update manager to version from '-dxp-version'.
* NOTE: Thanks for your feedback. Now we're ready for release v1.6, soon.
        Please check release-candidate as carefully as possible.

        Start with:
        ==============================
        DllExport -action Configure
        ==============================
        https://3F.github.io/DllExport/releases/latest/manager/
        https://www.youtube.com/watch?v=okPThdWDZMM&t=46s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants