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

C++ projects and their initialization via Microsoft.Build.Evaluation #1

Closed
3F opened this issue Jul 8, 2017 · 2 comments
Closed

C++ projects and their initialization via Microsoft.Build.Evaluation #1

3F opened this issue Jul 8, 2017 · 2 comments
Labels
3rd-party by design Not a bug. Just a feature. support
Milestone

Comments

@3F
Copy link
Owner

3F commented Jul 8, 2017

yes, again...
https://social.msdn.microsoft.com/Forums/en-US/2badfe39-1321-4ec4-9cc8-74bf4efd39b3/

// InvalidProjectFileException:"D:\Microsoft.Cpp.Default.props" - yes, because $(VCTargetsPath) is not defined.
new Project("Sample.vcxproj", new Dictionary<string, string>(), null);

// OK, because I also have 14.0
new Project("Sample.vcxproj", new Dictionary<string, string>(), "14.0");

// InvalidProjectFileException: The tools version "15.0" is unrecognized. 
// Available tools versions are: "12.0", "14.0", "2.0", "3.5", "4.0". - yes, I know why is so -_-
new Project("Sample.vcxproj", new Dictionary<string, string>(), "15.0");
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

-_-

Looks like the most easy way should be init by null and to define related properties to .ctor. I think should work o_o

3F added a commit that referenced this issue Oct 5, 2017
* NEW: Updated architecture now provides 2 types of handlers - readers (ISlnHandler) and writers (IObjHandler).
        You also can use your custom reader or writer, just implement an `ISlnHandler` or `IObjHandler`:

        ```
          class MyReader: LAbstract, ISlnHandler { ... }
          class MyWriter: WAbstract, IObjHandler { ... }
        ```

        Read the documentation for details.

* NEW: MvsSln now also may provide map of analyzed data. Parser will expose map through list of `ISection` for each line.
       To enable this, define a bit 0x0080 for type of operations to parser.
       This helps to get flexible control between readers and any writers.

       Example of using writer `WSolutionConfigurationPlatforms` together with calculated map:

        ```
          var data = new List<IConfPlatform>() {
              new ConfigSln("Debug", "Any CPU"),
              new ConfigSln("Release_net45", "x64"),
              new ConfigSln("Release", "Any CPU"),
          };

          var whandlers = new Dictionary<Type, HandlerValue>() {
              [typeof(LSolutionConfigurationPlatforms)] = new HandlerValue(new WSolutionConfigurationPlatforms(data)),
          };

          using(var w = new SlnWriter("<path_to>.sln", whandlers)) {
              w.Write(map);
          }
        ```

        Read the documentation for details.

* NEW: Implemented new writer `WProject`.
* NEW: Implemented new writer `WProjectConfigurationPlatforms`.
* NEW: Implemented new writer `WSolutionConfigurationPlatforms`.
* NEW: Implemented new writer `WVisualStudioVersion`.
* NEW: Implemented new writer `WProjectSolutionItems`.
* NEW: Implemented new reader `LVisualStudioVersion`.
* NEW: Implemented new reader `LProjectSolutionItems`.
* FIXED: Fixed possible bug when SlnItems.All &~ SlnItems.Projects.
* FIXED: Fixed possible null with PropertyItem.evaluatedValue:
           MS describes this as 'the evaluated property value, which is never null'
           But, this is not true: .NETFramework\v4.0\Microsoft.Build.dll - Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a

* FIXED: Fixed possible null for `IXProject.ProjectName` when project does not contain this property.
* CHANGED: `IXProject.ProjectGuid` now will return value from ProjectItem.pGuid if project file does not contain an Guid at all.
            It's actual for SDK-based projects.

* CHANGED: SlnParser now can be initialized without handlers at all.
            ```
              ISlnContainer sln = new SlnParser(false);
              sln.SlnHandlers.Register(new LMySpec());
              ...

              // to reset and register all default:
              sln.SetDefaultHandlers();
            ```

* CHANGED: Updated SlnItems: added `Map` item to create map when processing sln data.
* CHANGED: `IsolatedEnv.Load(...)` splitted and marked as virtual to leave the final implementation for user,
            to avoid problems like in Issue #1 etc.

* CHANGED: Updated abstract layer with some types from ISlnResult & ISlnResultSvc.
* CHANGED: Updated GetNuTool v1.6.1.10480_bde3e50 & hMSBuild v1.2.2.62992_3ee58c3.
* KNOWN_PROBLEM: C++ projects and their initialization for Visual Studio 2017. Issue #1.
@3F
Copy link
Owner Author

3F commented Aug 4, 2018

Same here, #5 (comment) solves problem. But this only for .netfx 4.6

v14.3.0 (.netfx 4.5) contains same problem by the way.

@3F
Copy link
Owner Author

3F commented Apr 29, 2024

Too many changes...
The main problem will be resolved together with #23

Looks like the most easy way should be init by null and to define related properties to .ctor. I think should work o_o

I think it does (populate everything what is needed) but this is wrong way according to Sdk etc.
My priority is IeXod
Closed.

@3F 3F closed this as completed Apr 29, 2024
@3F 3F added by design Not a bug. Just a feature. and removed bug labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd-party by design Not a bug. Just a feature. support
Projects
None yet
Development

No branches or pull requests

1 participant