Xamarin.forms: Edit and Continue doesn't work with .NET Standard

Created on 13 Jan 2018  路  8Comments  路  Source: xamarin/Xamarin.Forms

When a Xamarin.Forms cross-platform library uses .NET Standard, Edit and Continue doesn't work on UWP. (I didn't try other ways of incorporating the cross-platform code, so I don't know whether this is specific to .NET Standard.)

Repro:

  1. Create a new UWP project.
  2. Add a .NET Standard class library.
  3. Verify that Edit and Continue works. (Start the app. Debug > Break All. Edit some code in the class library. Continue.)
  4. Add Xamarin.Forms to the class library and UWP project. Add a page to the class library. Add the standard startup code to the UWP project. This repro project is in this state.
  5. Test whether Edit and Continue works. Notice that it doesn't (although Edit and Continue does work if you edit the UWP project).

In the repro project, the Error List window doesn't show any errors. However, for my production project, this error appears:

Error CS7038: Failed to emit module '_name_'.

buildchain UWP bug

Most helpful comment

This is NOT working on my VS 15.9.4 if I open a project which is created on another computer.
But if I create a new project on my system it will work correctly.

All 8 comments

I do believe this works in newer version of VS:
editcontinuexamarinformsuwpcode

This is NOT working on my VS 15.9.4 if I open a project which is created on another computer.
But if I create a new project on my system it will work correctly.

This is NOT working on my VS 15.9.4 if I open a project which is created on another computer.
But if I create a new project on my system it will work correctly.

Do you have a sample?

Yes, there is a training project in Github.
Sample link
Edit and continiue is not working with this project in my visual studio. But edit and continue works correctly if I create a new project in my own system.

This is NOT working on my VS 15.9.4 if I open a project which is created on another computer.
But if I create a new project on my system it will work correctly.

Could you please try to edit & continue some codes in UWP project instead of changing .net standard library codes? @arminrasoulian
As an example, develop a custom renderer and try to change its codes at runtime. Surprisingly it gonna work on all machines. But changing .net standard library codes results into an error on some machines! :-S

This is NOT working on my VS 15.9.4 if I open a project which is created on another computer.
But if I create a new project on my system it will work correctly.

Could you please try to edit & continue some codes in UWP project instead of changing .net standard library codes? @arminrasoulian
As an example, develop a custom renderer and try to change its codes at runtime. Surprisingly it gonna work on all machines. But changing .net standard library codes results into an error on some machines! :-S

Yes, I've already tested this before, and the result is exactly as you said.

Not working on my VS 15.9.4 too.

Same here, VS 15.9.0

Was this page helpful?
0 / 5 - 0 ratings