Skip to content

Commit

Permalink
Fixed major error when restoring package via MSBuild after 4b61116
Browse files Browse the repository at this point in the history
```
msbuild ClassLibrary1.sln /t:Build
```

It was because of unevaluated value from imported nodes. For clarify, it should be evaluated in first build step, then MSBuild will cache this evaluated values (ref~ `<prjfile>.CoreCompileInputs.cache`), then it will work fine (i.e. only for second builds).

No problems for local scope, but it also can be like:

```
DllExport -action Restore & msbuild ClassLibrary1.sln /t:Build
```

Well, this commit just avoids global scope in `Reference` item.

+Also fixed DXP_PE_CHECK for allocator.
  • Loading branch information
3F committed Oct 27, 2017
1 parent 865cfaa commit 2e20ff8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Wizard/MSBuildProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public struct MSBuildProperties
{
public const string DXP_ID = "DllExportIdent";

/// <summary>
/// Meta library file name.
/// </summary>
public const string DXP_METALIB_NAME = "DllExportMetaLibName";

/// <summary>
/// https://github.com/3F/DllExport/issues/2
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions Wizard/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public Project(IXProject xproject, IConfigInitializer init)

AllocateProperties(
MSBuildProperties.DXP_ID,
MSBuildProperties.DXP_METALIB_NAME,
MSBuildProperties.DXP_NAMESPACE,
MSBuildProperties.DXP_ORDINALS_BASE,
MSBuildProperties.DXP_SKIP_ANYCPU,
Expand All @@ -214,6 +215,7 @@ public Project(IXProject xproject, IConfigInitializer init)
MSBuildProperties.DXP_CUSTOM_ILASM,
MSBuildProperties.DXP_INTERMEDIATE_FILES,
MSBuildProperties.DXP_TIMEOUT,
MSBuildProperties.DXP_PE_CHECK,
MSBuildProperties.PRJ_PLATFORM
);

Expand Down Expand Up @@ -324,6 +326,7 @@ protected void CfgNamespace()
{
CfgDDNS();

SetProperty(MSBuildProperties.DXP_METALIB_NAME, UserConfig.METALIB_NAME);
SetProperty(MSBuildProperties.DXP_NAMESPACE, Config.Namespace ?? String.Empty);
SetProperty(MSBuildProperties.DXP_DDNS_CECIL, Config.UseCecil);
}
Expand Down
5 changes: 5 additions & 0 deletions Wizard/UserConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public class UserConfig: IUserConfig
/// </summary>
public const string NS_DEFAULT_VALUE = "System.Runtime.InteropServices";

/// <summary>
/// Default meta library.
/// </summary>
public const string METALIB_NAME = "DllExport.dll";

/// <summary>
/// Flag of installation.
/// </summary>
Expand Down

0 comments on commit 2e20ff8

Please sign in to comment.