When i change code in VS and try to compile it from editor, changes does not apply

I’ve just reinstalled visual studio (2017), and unreal engine v 4.18.3. When i create new project, my engine editor opens, and then VS instance. When i do some changes in code in VS, and try to compile it in editor, it just compiles instantly but does not apply that changes, that i’ve made in code. I can still compile my code, if i run it through VS. but it is just too annoying to do that constantly. Also, when i try to open one of c++ files in editor, it opens 2 instances of VS. The first one is my c++ files included in solution, but the second instance contains just that file, outside my project solution.
Doen someone know how to fix that?

1 Like

Do you run the project via VS, or .uproject file?

Cant say for sure… I create new unreal project, VS opens. I edit code in VS, compile in editor → changes does not apply. Compile in VS → it compiles as it should compile via VS. If i try double click C++ file in editor, it opens 2 VS instances with that file opened. File in first instance is included in solution, file in second instance is just separated, without dependence.

Open sln file of the project, VS will open, then run the project in VS, wait till UE4 opens, change sth in the code in VS, and then try to recompile in UE4. Should work, if not tell me which step is different.

Still not working like it should. I opened .sln file, then run the project. UE4 opened, i changed the code in VS and tried to compile it in UE4. Compilation passed too fast, not applying the changes.
To apply it i should stop the debugging, so UE4 window closes, and then run code in VS again. Then yes, it applies.
Maybe i did smth wrong in VS? The project was in debug mode, i could pause or stop debugging. Bt if i try to change smth during pause, i couldnt continue debugging due to error.

Error ‘CellPawn.cpp’ in ‘UE4Editor-Cell.dll’ was not compiled with Edit and Continue enabled. Ensure that the file is compiled with the Program Database for Edit and Continue (/ZI) option. Edit and Continue

Sorry, if i saying smth dumb, i’m pretty new to subject. Thanks for help, even if it will ocure as unfixable, the way u suggested me to run it is at least semiworkable.

Edit

Well, i think, i’ve found the main reason of my problem, though it is still pretty strange. All that time i tried to test if evrything is allright and set up by switching one variable in constructor from true to false. When i tried to do something like adding new variables to my class, and modifiing tick function, for example, allmost everything worked as it should be. Still cant get, what is the reason of that, but its gonna be much easier from now. Thanks for assistance, but if you know, why constructor changes are not applying, or even how to fix that, would still be very gratefull :D. Thanks again for attention

I’ve found out, that if i do something but small change in constructor, like adding new variables to class, or updating tick functions, not just switching variable from true to false, it works like it should be. Strange feature, though. But thanks for attention.

I clarified everything. It was me dumbass, not UE. All this time i tried to change constructor, but i didnt replace my old instance of that object with the new, recompiled one.

Tried to dig a bit about this topic, but I failed. I got interested in this error, maybe you could post a new - more specific question regarding this problem, so that someone could enlighten us?

I’m sorry, but that wasn’t even a bug, it was just me, who hadnt enough experience. All changes are compiling. But in the case of constructor i had to delete actor from scene and add it again(it’s updated version), but i thought, i do not have to do that. Sorry for disturbance, i know how it looks, but i’m just learning. U still were really helpfull, thank you.

I have the same problem working on Ubuntu with CLion IDE. But on my other PC with Windows 10 and VS 2017 I can add/change any UPROPERTY, UFUCTION or constructors initializer list, and all of them after compile via VS changes on the editor side on fly as well…

It is known issue in v18 of the engine. I also had to switch to v19preview to be able to compile projects and open cpp classes without annoying multiple msvs instances.

UE-51608

-will be fixed in v19