voicerecorder icon indicating copy to clipboard operation
voicerecorder copied to clipboard

Solution will not build in vs2017

Open bobishkindaguy opened this issue 7 years ago • 7 comments
trafficstars

The solution as posted will not run in vs 2017. After a Clean, the Rebuild fails, but no errors show up. Is there anything we need to install first?

bobishkindaguy avatar Jul 12 '18 20:07 bobishkindaguy

this project was created years ago, well before VS 2017. Don't know why its not building. Are you sure there's no output from the build?

markheath avatar Jul 13 '18 13:07 markheath

I have a feeling it's not the project. There is a significant number of posts describing similar problems, by searching on: visual studio 2017 rebuild failed but no errors

I'll post any resolution I find. Thanks

bobishkindaguy avatar Jul 13 '18 16:07 bobishkindaguy

(I am working in the ~VBPort solution) Not sure if all of the following were needed or if they are somehow interdependent.

  1. I had to uncheck "Enable ClickOnce security settings" in the Security tab of the project properties window. There was a problem with a "certificate".

  2. I had to install the latest versions of NUnit and MVVMLight in the Package Manager Console window.

  3. There seemed to be a problem with this line in the constructor of MainWindow: AddHandler Me.Closed, Sub(s, e) vm.Dispose()

  4. In MainWindowViewModel.vb, VS had a couple of issues with the following sub declaration:

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) Messenger.Default.Send(New ShuttingDownMessage(currentViewName)) CType(CurrentView.DataContext, IDisposable).Dispose() MyBase.Dispose(disposing) End Sub

The errors were: (in the declaration) --- sub 'Dispose' cannot be declared 'Overrides' because it does not override a sub in a base class. (on the line "MyBase.Dispose(disposing) --- 'Dispose' is not a member of 'ViewModelBase'.

I haven't fully researched those yet to see how to fix them, but remming the "Dispose" sub and the "AddHandler" line in the constructor allowed me to build successfully.

Now I'm working on why the "record" image button does not become enabled. The meter shows response to sounds (e.g.my voice) though.

Thanks for such a cool project. If I can get this working, I can add this to my product, so that my customers (municipalities and schools) will be able to record the "outgoing message" for notifications to their clients without having to call the user's phone, as they currently do.

Bob

bobishkindaguy avatar Jul 13 '18 19:07 bobishkindaguy

So I decided to see if the problem(s) may have been the port to VB. So in the c# project, I only had to uncheck "Sign the ClickOnce manifests" in the project properties, to get it to work. Also, the "Record" image (button) was enabled, as one would expect.

A couple of questions:

  1. Is it important to get my own certificate for this? (I have never done that before.)

  2. Do you have VB expertise to understand why the AddHandler and Dispose problem(s), mentioned above, appear? (I will research this one, but in case you have an immediate insight, it would be appreciated.)

Finally, I searched for ".Enabled" to try to see why the record button was not enabling, but since I'm a Windows Forms programmer, I'm probably going to have to work a bit to see why the button is not enabled.

Bob

bobishkindaguy avatar Jul 13 '18 19:07 bobishkindaguy

Resolved the "Dispose" issues:

  1. I substituted "Cleanup" for dispose, in the AddHandler line in the constructor of MainWindow.
  2. In the c# project you had remmed the Dispose sub, of MainWindowViewModel.vb, so I did the same, which cleared up the "Dispose" issues.
  3. Still outstanding: At one point, I was unable to get a reference in the VB project to "System.Windows.Interactivity", so I removed it. Forgot to tell you that. I suspect that might be why the record button is disabled. I will research where this comes from since it does not appear in the "Assemblies" category of the Add References window.

bobishkindaguy avatar Jul 13 '18 19:07 bobishkindaguy

In the NuGet Package Manager Console, I did Find-Package "Windows.UI.Interactivity". Here is one of the results: Windows.UI.Interactivity {1.3.0} Windows.UI.Interactivity is a port of System.Windows.Interactivity to the Windows Runtime and allows you to use behaviors and triggers as in Silverlight.

And if I do Install-Package, I get this error: install-package : Could not install package 'Windows.UI.Interactivity 1.3.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

So I'm wondering if it would be possible to make the project work without System.Windows.Interactivity.

Have you heavily used this, which the description says "allows you to use behaviors and triggers as in Silverlight"? Any thoughts on handling these without that package?

bobishkindaguy avatar Jul 13 '18 20:07 bobishkindaguy

The VB port was done by someone else - I don't think I ever used it myself. I should probably delete it from this repository. The signing was just so I could deploy this with ClickOnce and can be safely ignored.

markheath avatar Jul 17 '18 20:07 markheath