Skip to content

Use of IsolatedContext breaks tests in user-created AppDomain #1917

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

Closed
CharliePoole opened this issue Dec 1, 2016 · 0 comments · Fixed by #1919
Closed

Use of IsolatedContext breaks tests in user-created AppDomain #1917

CharliePoole opened this issue Dec 1, 2016 · 0 comments · Fixed by #1919

Comments

@CharliePoole
Copy link
Member

In fixing issue #1914, I had to comment out a test in LowTrustFixture.cs, which ran code in a separate AppDomain created by the user.

The problem is that the TestExecutionContext is marshalled by reference, while some of it's members are neither MBR nor serializable. Accessing any such member causes a remoting error. This is a consequence of the fact that we don't explicitly support running tests in a separate AppDomain but nothing stops a user from creating an AppDomain in their tests.

The particular test commented out uses Assert.Throws, which now creates an isolated context for the delegate it executes. Creating the context in a separate domain involves copying members across the remoting boundary. I think we can avoid this by using a public method of TestExecutionContext to create the isolated domain in the original context.

We have a few other issues that relate to problems in user-created AppDomains: #42 and #71. They may be due to the same phenomenon, so I'll look at them at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants