How to fix error System InvalidOperationException The contract name

preview_player
Показать описание
Error :
System.InvalidOperationException: The contract name 'GettingStartedLib.IService1' could not be found in the list of contracts implemented by the service

More Info
Рекомендации по теме
Комментарии
Автор

I just had a lot of unnecessary text in Form1.vb.

e.g. ublic Enum MouseState As Byte
None = 0
Over = 1
Down = 2
End Enum

Module Draw
Public Function RoundRect(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
Dim P As GraphicsPath = New GraphicsPath()
Dim ArcRectangleWidth As Integer = Curve * 2
P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
Return P
End Function
Public Function RoundRect(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer, ByVal Curve As Integer) As GraphicsPath
Dim Rectangle As Rectangle = New Rectangle(X, Y, Width, Height)
Dim P As GraphicsPath = New GraphicsPath()
Dim ArcRectangleWidth As Integer = Curve * 2
P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
Return P
End Function
Private Function ImageFromCode(ByRef str$) As Image
Dim imageBytes As Byte() = Convert.FromBase64String(str)
Dim ms As New IO.MemoryStream(imageBytes, 0, imageBytes.Length) : ms.Write(imageBytes, 0, imageBytes.Length)
Dim i As Image = Image.FromStream(ms, True) : Return i
End Function
Public Function TiledTextureFromCode(ByVal str As String) As TextureBrush
Return New TextureBrush(Draw.ImageFromCode(str), WrapMode.Tile)
End Function
End Module

Public Class RedemptionButton
Inherits Control
Dim MouseState As MouseState = MouseState.None
Enum HorizontalAlignment As Byte
Left
Center
Right
End Enum
Private _TextAlign As HorizontalAlignment = HorizontalAlignment.Center
Public Property TextAlign() As HorizontalAlignment
Get
Return _TextAlign
End Get
Set(ByVal value As HorizontalAlignment)
_TextAlign = value
Invalidate()
End Set
End Property

Public Sub New()
MyBase.New()
SetStyle(ControlStyles.AllPaintingInWmPaint, True)
SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
BackColor = Color.Transparent
Font = New Font("Arial", 8.25F, FontStyle.Bold)
End Sub
Protected Overrides Sub OnPaint(e As PaintEventArgs)
Dim curve As Integer = 5
Dim b As New Bitmap(Width, Height)
Dim g As Graphics = Graphics.FromImage(b)
g.SmoothingMode = SmoothingMode.HighQuality
g.TextRenderingHint = TextRenderingHint.AntiAlias
MyBase.OnPaint(e)
If Enabled Then
g.Clear(BackColor)
Select Case MouseState
Case MouseState.None
Dim MainBody As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(55, 62, 70), Color.FromArgb(43, 44, 48), 90S)
g.FillPath(MainBody, Draw.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), curve))
Dim GlossPen As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(93, 98, 104), Color.Transparent, 90S)
g.DrawPath(New Pen(GlossPen), Draw.RoundRect(New Rectangle(0, 1, Width - 1, Height - 1), curve + 1))
Case MouseState.Over
Dim MainBody As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(72, 79, 87), Color.FromArgb(48, 51, 56), 90S)
g.FillPath(MainBody, Draw.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), curve))
Dim GlossPen As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 3), Color.FromArgb(119, 124, 130), Color.FromArgb(64, 67, 72), 90S)
g.DrawPath(New Pen(GlossPen), Draw.RoundRect(New Rectangle(1, 1, Width - 3, Height - 3), curve))
Case MouseState.Down
Dim MainBody As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(43, 44, 48), Color.FromArgb(51, 54, 59), 90S)
g.FillPath(MainBody, Draw.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), curve))
Dim GlossPen As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(55, 56, 60), Color.Transparent, 90S)
g.DrawPath(New Pen(GlossPen), Draw.RoundRect(New Rectangle(0, 1, Width - 1, Height - 1), curve + 1))
End Select

g.DrawPath(New Pen(Color.FromArgb(31, 36, 42)), Draw.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), curve))
Else

End If


Dim sf As New StringFormat()
Select Case TextAlign
Case HorizontalAlignment.Center
sf.Alignment = StringAlignment.Center
sf.LineAlignment = StringAlignment.Center
g.DrawString(Text, Font, New SolidBrush(Color.FromArgb(16, 20, 21)), New Rectangle(1, 2, Width - 1, Height - 1), sf)
g.DrawString(Text, Font, Brushes.White, New Rectangle(0, 1, Width - 1, Height - 1), sf)
Case HorizontalAlignment.Left
sf.Alignment = StringAlignment.Near
sf.LineAlignment = StringAlignment.Center
g.DrawString(Text, Font, New SolidBrush(Color.FromArgb(16, 20, 21)), New Rectangle(6, 2, Width - 1, Height - 1), sf)
g.DrawString(Text, Font, Brushes.White, New Rectangle(5, 1, Width - 1, Height - 1), sf)
Case HorizontalAlignment.Right
sf.Alignment = StringAlignment.Far
sf.LineAlignment = StringAlignment.Center
g.DrawString(Text, Font, New SolidBrush(Color.FromArgb(16, 20, 21)), New Rectangle(-3, 2, Width - 1, Height - 1), sf)
g.DrawString(Text, Font, Brushes.White, New Rectangle(-4, 1, Width - 1, Height - 1), sf)
End Select


e.Graphics.DrawImage(b, New Point(0, 0))
g.Dispose()
b.Dispose()
End Sub
Protected Overrides Sub OnMouseEnter(e As EventArgs)
If Enabled Then
MyBase.OnMouseEnter(e) : MouseState = MouseState.Over : Invalidate() : Cursor = Cursors.Hand
End If
End Sub
Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
If Enabled Then
MyBase.OnMouseDown(e) : MouseState = MouseState.Down : Invalidate() : Cursor = Cursors.Hand
End If
End Sub
Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
If Enabled Then
MyBase.OnMouseUp(e) : MouseState = MouseState.Over : Invalidate() : Cursor = Cursors.Hand
End If
End Sub
Protected Overrides Sub OnMouseLeave(e As EventArgs)
If Enabled Then
MyBase.OnMouseLeave(e) : MouseState = MouseState.None : Invalidate() : Cursor = Cursors.Default
End If
End Sub
Protected Overrides Sub OnTextChanged(e As EventArgs)
MyBase.OnTextChanged(e)
Invalidate()
End Sub
End Class

End Sub

End Class

wi_zeus
Автор

you should really use something to help me understand what it is you are doing... something to go along with the video... you know to let me better understand... what is it that does that again???? oh yeah I remember AUDIO

imfams
welcome to shbcf.ru