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

Loading native dll's correctly for UWP release mode #1234

Merged
merged 5 commits into from
Oct 27, 2017
Merged

Loading native dll's correctly for UWP release mode #1234

merged 5 commits into from
Oct 27, 2017

Conversation

mayankbansal018
Copy link
Contributor

@mayankbansal018 mayankbansal018 commented Oct 26, 2017

public PlatformArchitecture GetCurrentProcessArchitecture()
{
// On ARM machines you cannot run x64/x86 process, so OS is ARM, we can safely say current process is ARM
if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE").Contains("ARM"))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering how does Android/ARM devices specify this?

Copy link
Contributor

Choose a reason for hiding this comment

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

ARM does have a 32bit and 64bit concept as well.

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 know that, but we currently do not have arm64 bits for native dll's that we are invoking. Are we saying we officially support running for arm64?

Copy link
Contributor

Choose a reason for hiding this comment

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

The spec is not clear here. Implementation is incomplete - confusing OS architecture with Process Architecture.

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've mentioned this in the comment "// On ARM machines you cannot run x64/x86 process, so OS is ARM, we can safely say current process is ARM"
Yes, I'm using OS Architecture to determine, but that is for ARM processes.

Another way would be to read the PE header of current process, which is certainly not good.

@@ -42,6 +42,18 @@ public interface IProcessHelper
string GetTestEngineDirectory();

/// <summary>
/// Gets the location of msdia140.dll, depending on current process architecture..
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: may not hardcode name of a consumed assembly here. It could be anything, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

msdia, is just an example here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Move it to remarks section in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

@@ -556,19 +556,11 @@ internal static class DiaSourceObject

public static IDiaDataSource GetDiaSourceObject()
{
var currentDirectory = new ProcessHelper().GetCurrentProcessLocation();
var currentDirectory = new ProcessHelper().GetNativeDllDirectory();
Copy link
Contributor

@codito codito Oct 27, 2017

Choose a reason for hiding this comment

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

nit: rename. nativeDllDirectory may not be currentDirectory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

Copy link
Contributor

@singhsarab singhsarab left a comment

Choose a reason for hiding this comment

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

Leave a comment

@mayankbansal018 mayankbansal018 merged commit 347c59f into microsoft:master Oct 27, 2017
@mayankbansal018 mayankbansal018 deleted the msdiauwpfix branch October 27, 2017 10:30
smadala pushed a commit to codito/vstest that referenced this pull request Oct 30, 2017
* Loading native dll's correctly for UWP release mode

* nit's

* decouple process bitness with OS Architecture
@codito codito mentioned this pull request Oct 30, 2017
smadala pushed a commit that referenced this pull request Oct 30, 2017
* Object Model Api fix (#1231)

* Adding the missing property LocalExtensionData in TestCase

* Fixed the test.

* Do not crash data collector if a extension initialize fails. (#1230)

* Do not crash data collector if a extension initialize fails.

* Add unit tests for the scenario.

* Fix for changes in XPathNavigator for netcoreapp2.0 (#1226)

* Fix for changes in XPathNavigator in netcoreapp2.0
* Removed IXPathNavigable.

* Use TPv2 as default for .NET 3.5. (#1232)

* Loading native dll's correctly for UWP release mode (#1234)

* Loading native dll's correctly for UWP release mode

* nit's

* decouple process bitness with OS Architecture

* HardCoded version of CLI to 2.1.0-preview1-007372 (#1238)

HardCoded version of CLI to 2.1.0-preview1-007372 as the latest version has some issues.

Reverted to old version of CLI because of dotnet/cli#7921

* Added null check for parent node.

* Added conditional statements to support building against netcoreapp1.0

* Get OSArchitecture from Platform Abstraction to check for ARM Processor (#1242)

* GetOsArchitecture from Platform Abstraction to check for ARM

* making sure path is always small
smadala pushed a commit to smadala/vstest that referenced this pull request Oct 31, 2017
* Loading native dll's correctly for UWP release mode

* nit's

* decouple process bitness with OS Architecture
@smadala smadala mentioned this pull request Oct 31, 2017
smadala added a commit that referenced this pull request Oct 31, 2017
* Object Model Api fix (#1231)

* Adding the missing property LocalExtensionData in TestCase

* Fixed the test.

* Do not crash data collector if a extension initialize fails. (#1230)

* Do not crash data collector if a extension initialize fails.

* Add unit tests for the scenario.

* Use TPv2 as default for .NET 3.5. (#1232)

* Loading native dll's correctly for UWP release mode (#1234)

* Loading native dll's correctly for UWP release mode

* nit's

* decouple process bitness with OS Architecture

* HardCoded version of CLI to 2.1.0-preview1-007372 (#1238)

HardCoded version of CLI to 2.1.0-preview1-007372 as the latest version has some issues.

Reverted to old version of CLI because of dotnet/cli#7921

* Get OSArchitecture from Platform Abstraction to check for ARM Processor (#1242)

* GetOsArchitecture from Platform Abstraction to check for ARM

* making sure path is always small
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants