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

IsolatedEnv and empty SolutionConfigurationPlatforms: "escapedValue" cannot be null #61

Closed
3F opened this issue Jan 11, 2020 · 0 comments
Labels
bug ⛶ CI Continuous Integration support ⛶ msbuild msbuild toolset
Milestone

Comments

@3F
Copy link
Owner

3F commented Jan 11, 2020

set __vssbe_diag= true to enable diagnostic mode.
Error when loading: 'System.ArgumentNullException: Parameter "escapedValue" cannot be null.
   at Microsoft.Build.Shared.ErrorUtilities.VerifyThrowArgumentNull(Object parameter, String parameterName, String resourceName)
   at Microsoft.Build.Execution.ProjectPropertyInstance.Create(String name, String escapedValue, Boolean mayBeReserved, ElementLocation location, Boolean isImmutable)
   at Microsoft.Build.Evaluation.ProjectCollection.SetGlobalProperty(String name, String value)
   at net.r_eg.vsSBE.IsolatedEnv..ctor(String solutionFile, IDictionary`2 properties)
   at net.r_eg.vsSBE.API.EventLevel.load(String sln, Dictionary`2 properties, ISettings cfg)
   at net.r_eg.vsSBE.Provider.Loader.load(String solutionFile, Dictionary`2 properties, String libPath, Boolean createDomain)
   at net.r_eg.vsSBE.Provider.Loader.load(String solutionFile, Dictionary`2 properties, String libPath)
   at net.r_eg.vsSBE.CI.MSBuild.Initializer.load(InitializerProperties prop)'
MSBUILD : Logger error MSB1029: Fatal error
 Build failed.

Possible when no SolutionConfigurationPlatforms records inside .sln, for example, projects such https://github.com/3F/GetNuTool

set cim=packages\vsSolutionBuildEvent\cim.cmd
call %cim% "gnt.sln" /v:m /m:4 

Temp solution

Either define any values for Configuration/Platform when invoking:

call %cim% "gnt.sln" /v:m /m:4 /p:Configuration=Release /p:Platform=x64

Or add SolutionConfigurationPlatforms with default value for .sln

Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
	EndGlobalSection

v

call %cim% "gnt.sln" /v:m /m:4 /p:Configuration=Release
:: now platform will be considered as /p:Platform=Any CPU
@3F 3F added bug ⛶ CI Continuous Integration support ⛶ msbuild msbuild toolset labels Jan 11, 2020
3F added a commit to 3F/hMSBuild that referenced this issue Jan 17, 2020
https://github.com/3F/GetNuTool/releases/tag/1.8

This also updates build scripts because of modern vsSolutionBuildEvent 1.14 (used from GetNuTool 1.8)
+known problem: 3F/vsSolutionBuildEvent#61

And as I promised, an compiled.full version now will be distributed together with official hMSBuild releases (zip package):
#11 (comment)
@3F 3F closed this as completed in 52aed2b Jul 9, 2020
@3F 3F added this to the 1.14.1 milestone Jul 9, 2020
3F added a commit that referenced this issue Jul 31, 2020
* FIXED: Fixed "escapedValue" cannot be null. Issue #61.

* FIXED: Fixed `#[Build cancel = true]` and related DTE-Commands.

        In fact it will prevent `Command "Build.Cancel" is not available` for the any context of use.
        This also now will ignore actions from Pre events if they used flag of the ignoring failed build
        (cancel request essentially means the same failure)

* FIXED: Fixed possible "[MSBuild]::GetDirectoryNameOfFileAbove('', sdkmanifest.xml)" cannot be evaluated.

* FIXED: Fixed possible "Project configuration is not found <- sln [Debug|Win32]"

* FIXED: CIM. Fixed support of the: /p:nowarn="1591;1701;1702" key.

* FIXED: Fixed possible (.dmp etc) problem when loading solution: Value cannot be null.

* FIXED: CIM. Fixed MSB4016: An item with the same key has already been added.

* FIXED: Fixed possible stackoverflow in IsolatedEnv & Environment implementations.

* FIXED: VS IDE. Fixed error counter and error list pane when loading incorrect .vssbe then closed solution
         and opened again.

* FIXED: Fixed possible System.TypeInitializationException:
        "The type initializer for 'Microsoft.Build.Evaluation.ToolsetConfigurationReader' threw an exception."

* NEW: Implemented GUI for CIM versions.
       First of all CIM now is part of the main project for CI support!
       And the new CI.GUI module just provides convenient access to scripts and settings without VS IDE.

* NEW: Implemented SolutionConfigurations and SolutionActiveCfg by using MvsSln in IsolatedEnv (API vsSBE part).

* CHANGED: CIM (CI.MSBuild) now is part of the main project for CI support!

* CHANGED: Added .sln search if no arg for CIM.
           Helps to avoid MSB1029 "We can't detect .sln file in arguments" by default.

* CHANGED: `Script` mode is now the default type for new actions.

* CHANGED: Mixing codes from client libraries (API) to the end results for API EventLevel implementation.

* CHANGED: SDK 15 will use .NET Framework: 4.7.2.

* CHANGED: Improved argument processing for CIM. PR #67.
           Both msbuild formats: `/property:` and `-property:`, ...

* CHANGED: Removed logic for upgrading config. Migration 0.8 -> 0.9.
           Please use any related releases before 1.14.1 if you need automatic update.

* CHANGED: .vssbe Minimal version now is 0.12.4 due to removed the "Command" property from config.

* CHANGED: Pack of changes for .vssbe: Component list; Command Property; Default properties;... PR #66.

* CHANGED: API. IEnvironment.ProjectsList now implemented through ISlnResult.ProjectItems (MvsSln).

* CHANGED: Updated the follwoing references:

            * MSBuild 16.6.0 for SDK15 only
              https://www.nuget.org/packages/Microsoft.Build/16.6.0

            * MvsSln 2.5.3
              https://github.com/3F/MvsSln/releases/tag/2.5.3

            * 7z.Libs 19.0.2
              https://github.com/3F/7z.Libs/releases/tag/19.0.2

            * E-MSBuild 1.14.1
              https://github.com/3F/E-MSBuild/releases/tag/1.14.1

            * GetNuTool 1.8
              https://github.com/3F/GetNuTool/releases/tag/1.8

            * hMSBuild 2.3
              https://github.com/3F/hMSBuild/releases/tag/v2.3

            * AvalonEdit 6.0.1
              https://github.com/icsharpcode/AvalonEdit/releases/tag/v6.0.1

            * Microsoft.VisualStudio.SDK.EmbedInteropTypes 15.0.30
              https://aka.ms/VsExtensibility

            * Newtonsoft.Json 12.0.3
              https://github.com/JamesNK/Newtonsoft.Json/releases/tag/12.0.3

            * NLog 4.7.2
              https://github.com/NLog/NLog/releases/tag/v4.7.2

            * Castle.Core 4.4.1
              https://github.com/castleproject/Core/releases/tag/v4.4.1

            * Moq 4.14.5
              https://github.com/moq/moq4/releases/tag/v4.14.5

            * System.Runtime.CompilerServices.Unsafe 4.7.1
              https://go.microsoft.com/fwlink/?LinkID=799421

            * System.Threading.Tasks.Extensions 4.5.4
              https://go.microsoft.com/fwlink/?LinkID=799421

            * LSender 1.15
            https://github.com/3F/LSender/releases/tag/1.15

* NOTE: NuGet Packages now provides GUI wrapper to use it completely without VS IDE.

        https://www.nuget.org/packages/vsSolutionBuildEvent
        Access it through GUI.bat helper inside root pkg dir.

* NOTE: You can also receive easily our NuGet Packages through `get-vsSBE.1.14.1.bat` script:

        https://github.com/3F/vsSolutionBuildEvent/releases
        then access anything with us.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ⛶ CI Continuous Integration support ⛶ msbuild msbuild toolset
Projects
None yet
Development

No branches or pull requests

1 participant