Add a library reference when copying a file between projects?


(mtiede) #1

I did a drag and drop of a file (xaml and backing file came with it) into a .Net standard library project in Visual Studio 2017. It won’t compile and complains about “Unknown identifier InitializeComponent” which would be in a UserControl. I think I have added the libraries that it depends on, but it must require something else. It would be nice if when a file is dragged and dropped, the library dependencies could be automatically determined (by Reflection?) and then have those libraries automatically added to the new project. As it is, I’m just hunting and pecking between a whole bunch of libraries in the original project to try to guess what is required.

And of course, every time I alter the libraries, the thing won’t compile because it complains about having no matching target (Echoes .Net or Echoes .Net Standard). And to fix that I have to go to Water to compile it. Then VS 2017 will be happy with that part and I can find out if I still have the problem with the InitializeComponent.

Or can one just not use UserControls in .Net Standard libraries?


(marc hoffman) #2

Sounds like a wrong build action on the .xaml, or a mismatched namespace between xaml and code file.


(marc hoffman) #3

As for the referend issue, is that with 2345 or later? Ours that was fixed for 2345. If you are using that, a new test case/steps would be appreciated. Thanx!


(mtiede) #4

With the 2344 personal (nov 14) one you made for me. I’ll get the 2345 and try again later.


(marc hoffman) #5

Ok, that should be same diff.

but the last where building it in water once fixes it is weird. so when exactly does it break again for VS? when the referenced library gets rebuilt? can I get two details rebuild logs form VS, one when it works, and then one when it fails?


(mtiede) #6

Ok, I’ll get the 2345 version and do more testing. Not quite sure how to get detail rebuild logs from VS. Will look around. (I usually hardly look at the logs at all. :slight_smile: Just Errors)


(marc hoffman) #7

“Tools|Options|Project & Solutions”, somewhere.

thanx!


(mtiede) #8

I think I found it. “Build and Run”. Should I do “Detailed” or “Diagnostic”?


(mtiede) #9

Here are the files showing Diagnostic listing after removing and re-adding a reference, then recompiling with Water, and recompiling with VS.

Error after adding project reference to main.txt (81.5 KB)
Ok after build in Water.txt (88.7 KB)

Let me know if you need “Detailed” instead.


(marc hoffman) #10
		               -> Target Echoes started.
		D:                Using cached data for ResolveReferences (5:04 PM <= 5:06 PM)
		               <- Target Echoes finished.

no good :(. I need a rebuild for both, because otherwise the relevant infos wont be in the log. This is exactly the phase im trying to compare, and its missing from “Ok after build in Water.txt”…


(mtiede) #11

Ok. I’ll try again. I presume the Diagnostic vs. the Detailed IS what you want and will try a rebuild and see if the symptoms remain the same.


(marc hoffman) #12

The more verbose the better, so ideally do Diagnostic.


(marc hoffman) #13

Actually, from looking at the log again, I found a way to reproduce the issue. If I disable the library form building, in the test case I still have from you, it fails in Fire/Water, too. investigating now…


(marc hoffman) #14

Fixed.


(marc hoffman) #15

I started a new full build including Water, and will send it to you later today.


(mtiede) #16

Ok, just got back home and didn’t retry yet. So I’ll wait until you have a new version.


(marc hoffman) #17

New build is up for you now, .2348.


(mtiede) #18

Ok, I’ll give it a try.


(mtiede) #19

Build .2348 seems to have fixed it so far. In VS 2017 I removed the project reference and added it back in and did a rebuild. Previously, that would have failed. Now it appears to have worked.

I was also able to do a rebuild in Water without problems.

One odd thing. The InsteonValueConverters project reference had an icon that looked like a “link” with a yellow warning triangle on it. It didn’t affect the compilation. I removed that link and re-added it and now the warning is gone. Not sure what that was about, but it appears to be fixed now.

Thanks for the update.

… time passes …

On a separate note, in Water, the “link” I made in VS shows up as a link to the other project. How does one CREATE such a link in Water? I don’t see an “add reference from other project” menu choice anywhere. And the only way I could find was to add it through a “browse” operation which didn’t show the same kind of icon as that created by VS.


(marc hoffman) #20

hard to say without comparing the old project to the new…