|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Debugging a ClickOnce web-deployed appbe deployed via ClickOnce and set to "application is available online only". Before I published it, I tested it out, debugged, the whole 9 yards, and all worked smooth as can be. But once I publish/deploy it and run it, I am getting an "Object Reference not set to an instance of an object" error. Shortly after the app runs, the following property value is requested: Public ReadOnly Property WebsiteName() As String Get Dim queryString As NameValueCollection = GetQueryStringParameters() Dim URL As String = "" If queryString.HasKeys Then Dim protocol As String = queryString("prot").Trim() Dim server As String = queryString("server").Trim() URL = protocol & "//" & server End If Return URL End Get End Property The GetQueryStringParameters() function is as follows: Private Function GetQueryStringParameters() As NameValueCollection Dim nameValueTable As NameValueCollection = New NameValueCollection() Dim instance As ApplicationDeployment Try If (ApplicationDeployment.IsNetworkDeployed) Then instance = ApplicationDeployment.CurrentDeployment If Not IsNothing(instance) Then Dim activateUri As Uri = instance.ActivationUri If activateUri IsNot Nothing AndAlso activateUri.Query <> String.Empty Then nameValueTable = System.Web.HttpUtility.ParseQueryString(activateUri.Query) End If End If End If Catch ex As Exception Throw New Exception("BizLogic:GetQueryStringParameters() Failed:" & vbCrLf & ex.ToString) End Try Return nameValueTable End Function When I run/debug the app from Visual Studio, the ApplicationDeployment.IsNetworkDeployed returns FALSE so the above function never fully executes, it just returns a blank string. But when I publish/deploy the app, now that IF...THEN block does execute yet something inside it is throwing that Null Object error and I don't know what. I have tried using "System.Diagnostics.Debugger.Launch()" to get an instance of Visual Studio to let me debug, but when Visual Studio opens up, I get a warning message: "No symbols are loaded for any call stack frame. The source code cannot be displayed." and the only thing I can look at is the disassembly which looks like Machine Code. Any help is greatly appreciated. Thanks! -- Andrew Andrew,
With the Attach to process in the tab Debug you can attach an exe/dll to your visual studio project and then debug it. Cor Show quoteHide quote "Andrew Raastad" <notgi***@email.com> wrote in message news:A53D230C-7653-4B95-A549-D1A23C179EB7@microsoft.com... > Running into an error I can't figure out.... Have an application that is > to be deployed via ClickOnce and set to "application is available online > only". Before I published it, I tested it out, debugged, the whole 9 > yards, and all worked smooth as can be. But once I publish/deploy it and > run it, I am getting an "Object Reference not set to an instance of an > object" error. > > Shortly after the app runs, the following property value is requested: > > Public ReadOnly Property WebsiteName() As String > Get > Dim queryString As NameValueCollection = > GetQueryStringParameters() > Dim URL As String = "" > If queryString.HasKeys Then > Dim protocol As String = queryString("prot").Trim() > Dim server As String = queryString("server").Trim() > URL = protocol & "//" & server > End If > Return URL > End Get > End Property > > The GetQueryStringParameters() function is as follows: > > Private Function GetQueryStringParameters() As NameValueCollection > Dim nameValueTable As NameValueCollection = New > NameValueCollection() > Dim instance As ApplicationDeployment > > Try > If (ApplicationDeployment.IsNetworkDeployed) Then > instance = ApplicationDeployment.CurrentDeployment > If Not IsNothing(instance) Then > Dim activateUri As Uri = instance.ActivationUri > If activateUri IsNot Nothing AndAlso activateUri.Query > <> String.Empty Then > nameValueTable = > System.Web.HttpUtility.ParseQueryString(activateUri.Query) > End If > End If > End If > > Catch ex As Exception > Throw New Exception("BizLogic:GetQueryStringParameters() > Failed:" & vbCrLf & ex.ToString) > > End Try > > Return nameValueTable > > End Function > > > > When I run/debug the app from Visual Studio, the > ApplicationDeployment.IsNetworkDeployed returns FALSE so the above > function never fully executes, it just returns a blank string. But when I > publish/deploy the app, now that IF...THEN block does execute yet > something inside it is throwing that Null Object error and I don't know > what. > > I have tried using "System.Diagnostics.Debugger.Launch()" to get an > instance of Visual Studio to let me debug, but when Visual Studio opens > up, I get a warning message: "No symbols are loaded for any call stack > frame. The source code cannot be displayed." and the only thing I can look > at is the disassembly which looks like Machine Code. > > Any help is greatly appreciated. Thanks! > > -- Andrew > > Run the app, open VS2k8, Debug --> Attach to Process, find the app in the
list, click Attach and.... All I get is a single window with: "(Disassembly cannot be displayed in run mode.)" Any other ideas? -- Andrew Show quoteHide quote "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message news:%23dBdeMS2JHA.4632@TK2MSFTNGP02.phx.gbl... > Andrew, > > With the Attach to process in the tab Debug you can attach an exe/dll to > your visual studio project and then debug it. > > Cor > > "Andrew Raastad" <notgi***@email.com> wrote in message > news:A53D230C-7653-4B95-A549-D1A23C179EB7@microsoft.com... >> Running into an error I can't figure out.... Have an application that is >> to be deployed via ClickOnce and set to "application is available online >> only". Before I published it, I tested it out, debugged, the whole 9 >> yards, and all worked smooth as can be. But once I publish/deploy it and >> run it, I am getting an "Object Reference not set to an instance of an >> object" error. >> >> Shortly after the app runs, the following property value is requested: >> >> Public ReadOnly Property WebsiteName() As String >> Get >> Dim queryString As NameValueCollection = >> GetQueryStringParameters() >> Dim URL As String = "" >> If queryString.HasKeys Then >> Dim protocol As String = queryString("prot").Trim() >> Dim server As String = queryString("server").Trim() >> URL = protocol & "//" & server >> End If >> Return URL >> End Get >> End Property >> >> The GetQueryStringParameters() function is as follows: >> >> Private Function GetQueryStringParameters() As NameValueCollection >> Dim nameValueTable As NameValueCollection = New >> NameValueCollection() >> Dim instance As ApplicationDeployment >> >> Try >> If (ApplicationDeployment.IsNetworkDeployed) Then >> instance = ApplicationDeployment.CurrentDeployment >> If Not IsNothing(instance) Then >> Dim activateUri As Uri = instance.ActivationUri >> If activateUri IsNot Nothing AndAlso activateUri.Query >> <> String.Empty Then >> nameValueTable = >> System.Web.HttpUtility.ParseQueryString(activateUri.Query) >> End If >> End If >> End If >> >> Catch ex As Exception >> Throw New Exception("BizLogic:GetQueryStringParameters() >> Failed:" & vbCrLf & ex.ToString) >> >> End Try >> >> Return nameValueTable >> >> End Function >> >> >> >> When I run/debug the app from Visual Studio, the >> ApplicationDeployment.IsNetworkDeployed returns FALSE so the above >> function never fully executes, it just returns a blank string. But when >> I publish/deploy the app, now that IF...THEN block does execute yet >> something inside it is throwing that Null Object error and I don't know >> what. >> >> I have tried using "System.Diagnostics.Debugger.Launch()" to get an >> instance of Visual Studio to let me debug, but when Visual Studio opens >> up, I get a warning message: "No symbols are loaded for any call stack >> frame. The source code cannot be displayed." and the only thing I can >> look at is the disassembly which looks like Machine Code. >> >> Any help is greatly appreciated. Thanks! >> >> -- Andrew >> >> > Andrew Raastad wrote:
> Run the app, open VS2k8, Debug --> Attach to Process, find the app in Press Ctrl+Break?> the list, click Attach and.... > > All I get is a single window with: "(Disassembly cannot be displayed > in run mode.)" > > > Any other ideas? Armin Thanks to all who offered suggestions. I have been able to solve the
problems I was having, though I never could get the debugging aspect to work. Had to resort to message boxes to display variable values at certain places to find the problem I was encountering. I would, however, still like to know how you are supposed to debug an application after it has been compiled and completely separate from the Visual Studio environment. -- Andrew Show quoteHide quote "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message news:%23dBdeMS2JHA.4632@TK2MSFTNGP02.phx.gbl... > Andrew, > > With the Attach to process in the tab Debug you can attach an exe/dll to > your visual studio project and then debug it. > > Cor > > "Andrew Raastad" <notgi***@email.com> wrote in message > news:A53D230C-7653-4B95-A549-D1A23C179EB7@microsoft.com... >> Running into an error I can't figure out.... Have an application that is >> to be deployed via ClickOnce and set to "application is available online >> only". Before I published it, I tested it out, debugged, the whole 9 >> yards, and all worked smooth as can be. But once I publish/deploy it and >> run it, I am getting an "Object Reference not set to an instance of an >> object" error. >> >> Shortly after the app runs, the following property value is requested: >> >> Public ReadOnly Property WebsiteName() As String >> Get >> Dim queryString As NameValueCollection = >> GetQueryStringParameters() >> Dim URL As String = "" >> If queryString.HasKeys Then >> Dim protocol As String = queryString("prot").Trim() >> Dim server As String = queryString("server").Trim() >> URL = protocol & "//" & server >> End If >> Return URL >> End Get >> End Property >> >> The GetQueryStringParameters() function is as follows: >> >> Private Function GetQueryStringParameters() As NameValueCollection >> Dim nameValueTable As NameValueCollection = New >> NameValueCollection() >> Dim instance As ApplicationDeployment >> >> Try >> If (ApplicationDeployment.IsNetworkDeployed) Then >> instance = ApplicationDeployment.CurrentDeployment >> If Not IsNothing(instance) Then >> Dim activateUri As Uri = instance.ActivationUri >> If activateUri IsNot Nothing AndAlso activateUri.Query >> <> String.Empty Then >> nameValueTable = >> System.Web.HttpUtility.ParseQueryString(activateUri.Query) >> End If >> End If >> End If >> >> Catch ex As Exception >> Throw New Exception("BizLogic:GetQueryStringParameters() >> Failed:" & vbCrLf & ex.ToString) >> >> End Try >> >> Return nameValueTable >> >> End Function >> >> >> >> When I run/debug the app from Visual Studio, the >> ApplicationDeployment.IsNetworkDeployed returns FALSE so the above >> function never fully executes, it just returns a blank string. But when >> I publish/deploy the app, now that IF...THEN block does execute yet >> something inside it is throwing that Null Object error and I don't know >> what. >> >> I have tried using "System.Diagnostics.Debugger.Launch()" to get an >> instance of Visual Studio to let me debug, but when Visual Studio opens >> up, I get a warning message: "No symbols are loaded for any call stack >> frame. The source code cannot be displayed." and the only thing I can >> look at is the disassembly which looks like Machine Code. >> >> Any help is greatly appreciated. Thanks! >> >> -- Andrew >> >> >
Windows 7 dll import problem
The process cannot access the file (in Windows2003 only) copying folders error when updating Listview after record add Can you edit auto generated Partial Class Designer VB code? create reference number based on old one... Detecting Design Time vs Run Time Property Set action unable to remove items from Listbox Radio buttond and combo boxes BigInteger and BigDecimal [equivalents] for VB.NET? |
|||||||||||||||||||||||