New-CMTaskSequenceMedia Help : Object Reference Not Set to Instance of Object
Having trouble creating a script to automate creation of bootable task sequence media. The following returns "Object Reference not set to an instance of an object" and I can't seem to figure it out:
Import-Module (Join-Path $(Split-Path $env:SMS_ADMIN_UI_PATH) ConfigurationManager.psd1)
cd CM1:
$hash =@{}
$MPServers = @("Server003.fqdn.com","Server004.fqdn.com","Server005.fqdn.com")
$StartDate = (Get-Date -Format "MM/dd/yyyy.HH:mm:ss").ToString()
$EndDate = "08/07/2025.12:12:12"
<#This section to be finished later:
#$hash.Add("SMSTSPreferredAdvertID","CM10017A")
#$hash.Add("OSDComputerName","BLDTMP08R2")
#$hash.Add("SMSTSPreferredAdvertID","CM100169")
#$hash.Add("OSDComputerName","BLDTMP2012")
#>
$hash.Add("SMSTSPreferredAdvertID","CM10016A")
$hash.Add("OSDComputerName","BLDTMP12R2")
$hash.Add("NBUType","NONBU")
$hash.Add("citrixyn","CITRIXOFF")
$hash.Add("ovoyn","OVOOFF")
$hash.Add("IsAutomation","YES")
New-CMTaskSequenceMedia -BootableMediaOption -MediaPath "c:\temp\ISOName.iso" -BootImageId "CM10008F" -MediaInputType "CDDVD" -DistributionPointServerName "Server023.fqdn.com" -ManagementPointServerName "Server003.fqdn.com","Server004.fqdn.com","Server005.fqdn.com" -MediaMode "Dynamic" -ProtectPassword $false -AllowUnattendedDeployment $true -CreateMediaSelfCertificate $True -EnableUnknownSupport $True -StartDate $StartDate -ExpirationDate $EndDate -Variable $Hash
We are running R2 CU2.
When I ran the command with -Verbose I recieved:
PS CM1:\> C:\Users\INAFN\Documents\codeBin\IsoGenerator.ps1
VERBOSE: Performing operation "New" on Target "TaskSequenceMedia: New".
VERBOSE: Executing WQL query: SELECT * FROM SMS_BootImagePackage pkg WHERE pkg.ActionInProgress!=3 And pkg.PackageID ='CM10008F'
VERBOSE: Query returned 1 results.
VERBOSE: Executing WQL query: Select dp.* from SMS_DistributionPoint As ref Join SMS_DistributionPointInfo As dp On ref.ServerNALPath=dp.NALPath and ref.SiteCode=dp.SiteCode Where ref.PackageID='CM10
008F' And dp.ServerName ='Servername.Domain.Com'
VERBOSE: Query returned 1 results.
VERBOSE: Executing WQL query: SELECT dp.ServerNALPath, dp.State, oci.SourceSize FROM SMS_PackageStatusDistPointsSummarizer AS dp JOIN SMS_BootImagePackage AS pkg ON pkg.PackageID=dp.PackageID JOIN SM
S_ObjectContentInfo as oci on oci.PackageID=pkg.PackageID WHERE dp.PackageID='CM10008F' AND pkg.ActionInProgress=0
VERBOSE: Query returned 30 results.
VERBOSE: Executing WQL query: SELECT scf.* FROM SMS_SCI_SysResUse AS scf JOIN SMS_SITE AS sit ON sit.SiteCode = scf.SiteCode WHERE scf.RoleName='SMS Management Point' AND site.Type != 1
VERBOSE: Query returned 5 results.
New-CMTaskSequenceMedia : Object reference not set to an instance of an object.
At C:\Users\INAFN\Documents\codeBin\IsoGenerator.ps1:25 char:1
+ New-CMTaskSequenceMedia -BootableMediaOption -MediaPath c:\temp\ISOName.iso -BootIm ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-CMTaskSequenceMedia], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.ConfigurationManagement.Cmdlets.Osd.Commands.NewTaskSequenceMediaCommand
Since it seemed to fail while pulling the MPs I switched to using just one MP as you had above, this time I get a different error:
PS CM1:\> C:\Users\INAFN\Documents\codeBin\IsoGenerator.ps1
VERBOSE: Performing operation "New" on Target "TaskSequenceMedia: New".
VERBOSE: Executing WQL query: SELECT * FROM SMS_BootImagePackage pkg WHERE pkg.ActionInProgress!=3 And pkg.PackageID ='CM10008F'
VERBOSE: Query returned 1 results.
VERBOSE: Executing WQL query: Select dp.* from SMS_DistributionPoint As ref Join SMS_DistributionPointInfo As dp On ref.ServerNALPath=dp.NALPath and ref.SiteCode=dp.SiteCode Where ref.PackageID='CM10
008F' And dp.ServerName ='Servername.Domain.Com'
VERBOSE: Query returned 1 results.
VERBOSE: Executing WQL query: SELECT dp.ServerNALPath, dp.State, oci.SourceSize FROM SMS_PackageStatusDistPointsSummarizer AS dp JOIN SMS_BootImagePackage AS pkg ON pkg.PackageID=dp.PackageID JOIN SM
S_ObjectContentInfo as oci on oci.PackageID=pkg.PackageID WHERE dp.PackageID='CM10008F' AND pkg.ActionInProgress=0
VERBOSE: Query returned 30 results.
VERBOSE: Executing WQL query: SELECT scf.* FROM SMS_SCI_SysResUse AS scf JOIN SMS_SITE AS sit ON sit.SiteCode = scf.SiteCode WHERE scf.RoleName='SMS Management Point' AND site.Type != 1
VERBOSE: Query returned 5 results.
VERBOSE:
VERBOSE:
New-CMTaskSequenceMedia : ConfigMgr Error Object:
instance of SMS_ExtendedStatus
Description = "The package name must be at least 1 and less than 50 characters in length.";
ErrorCode = 1078462208;
File = "e:\\qfe\\nts\\sms\\siteserver\\sdk_provider\\smsprov\\ssptspackage.cpp";
Line = 931;
ObjectInfo = "";
Operation = "PutInstance";
ParameterInfo = "";
ProviderName = "ExtnProv";
StatusCode = 2147749889;
At C:\Users\INAFN\Documents\codeBin\IsoGenerator.ps1:25 char:1
+ New-CMTaskSequenceMedia -BootableMediaOption -MediaPath c:\temp\ISOName.iso -BootIm ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Microsoft.Confi...nceMediaCommand:NewTaskSequenceMediaCommand) [New-CMTaskSequenceMedia], WqlQueryException
+ FullyQualifiedErrorId : UnhandledExeception,Microsoft.ConfigurationManagement.Cmdlets.Osd.Commands.NewTaskSequenceMediaCommand
PS CM1:\>
Similar Messages
-
SSAS Tabular - Adding Column to a table gives error "Object reference not set to instance of object"
If I make changes to a table in SSAS Tabular Visual Studio, the newly added column gives error as "Object
reference not set to instance of object"Hi VikasJain13,
According to your description, you get the "Object reference not set to instance of object" error when adding columns in Tabular. Right?
Generally, it throws this error when the internal code is accessing the property of an empty object. As you mentioned it happens when you make changes on a table, mostly it means that table is already a empty object. Please re-process your tabular to see
if this table is still existing.
If you have any question, please feel free to ask.
Simon Hou
TechNet Community Support -
Object Reference not set to instance of Object when sub-report on new page
I have a problem when my sub-report goes onto the second page of the report, with an error message.
My VB.NET displays a report and sub-report (in the footer) in a CrystalReportViewer:
- When both are on the first page, both display fine
- When the sub-report (or at least part) goes to the second page, the report displays OK, but without the subreport. When I go to page 2 of the report - hoping to see the sub-report - an error message is displayed, with title "Crystal Report Windows Forms Viewer" and text "Object Reference not set to an instance of an object".
This problem occurs both on my development machine in VS and at a user site.
Am desperate for some ideas please! I have VB.NET in Visual Studio 2010, and SAP Crystal Reports, version for Visual Studio 2010. The program is targeted for .NET Framework 3.5.
I looked for the HandleException event on my Windows Forms Viewer, as suggested by SAP and Microsoft, but cannot find this. See for [example|http://devlibrary.businessobjects.com/businessobjectsxi/en/en/crystalreports_dotnet_sdk/crystalreports_net_doc/doc/crsdk_net_doc/html/crlrfwindowsformscrystalreportviewerclasshandleexceptioneventtopic.htm]Usually, the error is due to the object going out of scope. Placing the object in a session may help. Moving the CR code to page init or page load may help. Looking at samples may help:
http://wiki.sdn.sap.com/wiki/x/JQBmBQ
CR Dev help files are here:
SAP Crystal Reports .NET API Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip
SAP Crystal Reports .NET SDK Developer Guide http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip
Finally, ensure you are using Service Pack 2 (see the sticky thread at the top of this forum).
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports] -
... And then what happens is the application fails to start. I have the cloud service set as the startup project, and the HttpFacingInterface project, an MVC application, set as the only role. I have tried loading and unloading everything
as well as deleteing the role and re-adding it in the cloud service. I'm not sure when this started, as I had been working on a third project in the solution, a unit test project, which also exists but isnt added as a role to the cloud service. Please
help, I'd like the application to run normally.hi Nathan,
Thanks for posting!
Did you want to add the UnitTest Project as a role into your azure project? Or Did you want to remove it?
If you want to add "UnitTest Project " as a role, the answer is no. This type project is only used as a test performance of your project. If you want to remove it from your project, you could right click on it, and select "remove
" directly. Or you could disable the checkbox on new project page, like this picture:
Also, you could refer to this solution from this page (http://www.amido.co.uk/mark-omahoney/publishing-in-windows-azure-object-reference-not-set-to-an-instance-of-an-object/
Hope it helps.
If I am misunderstanding, please let me know.
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
"Object reference not set to an instance of an object" when opening designer
I have a Windows Forms project which was originally developed in Visual Studio 2010. I migrated the project to VS2013, and now every time I open the project's main form, the designer complains of a null reference. If I hit "Ignore and Continue",
the code compiles just fine. The error in question appears in the "Windows Form Designer generated code" region. Even more curious, the line in question is not the first reference to the object. It's as if the first few times it needs to interact
with the object, it's fine, then at a certain point it becomes null.
Here is the call stack for the error:
at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component,
Object value)at
Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkPropertyDescriptor.SetValue(Object
component, Object value)at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager
manager, CodeAssignStatement statement, CodePropertyReferenceExpression
propertyReferenceEx, Boolean reportError)at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager
manager, CodeAssignStatement statement)at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager
manager, CodeStatement statement)
And here is the code in question:
this.optionsControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
this.optionsControl.IsAsciiMode = false;
this.optionsControl.Location = new System.Drawing.Point(3, 3);
this.optionsControl.LogControl = null;
this.optionsControl.Name = "optionsControl";
this.optionsControl.PlugInManager = null;
this.optionsControl.PortFacade = null;
this.optionsControl.Size = new System.Drawing.Size(613, 259);
this.optionsControl.TabIndex = 0;
The problem is reported at the third line, "this.optionsControl.Location = new System.Drawing.Point(3, 3);".Hi Eric,
I have made a research about your issue, and I found it might be caused by the usercontrol in the project. Was “this.optionsControl” a UserControl? It seems that this issue was difficult to handle.
If possible, I would recommend you recreate this control in a new project.
In addition, I think you could turn to the links below, they may be useful to you:
# How to get more information about exceptions thrown by the designer when switching from code to design view?
http://community.sharpdevelop.net/forums/p/16124/43105.aspx
# How to avoid WSODs in the Visual Studio 2005 Designer
http://www.codeproject.com/Articles/13584/How-to-avoid-WSODs-in-the-Visual-Studio-Desig
# design time error: object reference not set an instance of an object but runs fine
https://social.msdn.microsoft.com/Forums/vstudio/en-US/b3676bef-e457-4aac-b438-d3ed8a667e3f/design-time-error-object-reference-not-set-an-instance-of-an-object-but-runs-fine?forum=winforms
Best Regards,
Edward
This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,
Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you
completely understand the risk before retrieving any software from the Internet.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
"object reference not set to an instance of an object" after update datasource lightswitch
I'm using Latest Visual Studio 2013 Ultimate (2013.3) and when I attempt to open "update datasource" it throws an error
"Object reference not set to instance of an object."It's quite possibly an issue with the data source definition being dependent on a newer version of a lightswitch framework DLL. When I've hit these kinds of issues I've simply deleted the datasource, run a nuget refresh and added the datasource again.
If you have any code or queries, save a copy of the code-behind files and jot down the details of the queries before you try this. -
Crawler Help: Object reference not set to an instance of an object
I'm trying to write a custom crawler and having some difficulties. I'm getting the document information from a database. I'm trying to have the ClickThroughURL be a web URL and the IndexingURL be a UNC path to the file on a back-end file share. Also, I'm not using DocFetch. The problem I'm having is that when the crawler runs I get the following error for every card:
"4/19/05 13:43:30- (940) Aborted Card creation for document: TestDoc1. Import error: IDispatch error #19876 (0x80044fa4): [Error Importing Card.
Error writing Indexing File.
SOAP fault: faultcode='soap:Server' faultstring='Server was unable to process request. --> Object reference not set to an instance of an object.']"
Has anyone seen this before? Any help you can provide would be greatly appreciated. I have included the code from my document.vb in case that helps.
Thanks,
Jerry
DOCUMENT.VB
Imports System
Imports Plumtree.Remote.Util
Imports Plumtree.Remote.Crawler
Imports System.Resources
Imports System.Globalization
Imports System.Threading
Imports System.IO
Imports System.Data.SqlClient
Imports System.Text
Namespace Plumtree.Remote.CWS.MoFoDocsOpen
Public Class Document
Implements IDocument
Private m_logger As ICrawlerLog
Private DocumentLocation As String
Private d_DocumentNumber As Integer
Private d_Library As String
Private d_Name As String
Private d_Author As String
Private d_AuthorID As String
Private d_Category As String
Private d_ClientName As String
Private d_ClientNumber As String
Private d_DateCreated As DateTime
Private d_DocumentName As String
Private d_DocumentType As String
Private d_EnteredBy As String
Private d_EnteredByID As String
Private d_FolderID As String
Private d_KEFlag As String
Private d_LastEdit As DateTime
Private d_LastEditBy As String
Private d_LastEditByID As String
Private d_Maintainer As String
Private d_MaintainerID As String
Private d_MatterName As String
Private d_MatterNumber As String
Private d_Practice As String
Private d_Description As String
Private d_Version As Integer
Private d_Path As String
Private d_FileName As String
Public Sub New(ByVal provider As DocumentProvider, ByVal documentLocation As String, ByVal signature As String)
Dim location() As String = DocumentLocation.Split("||")
Me.DocumentLocation = DocumentLocation
Me.d_DocumentNumber = location(0)
Me.d_Library = location(2)
Dim objConn As New SqlConnection
Dim objCmd As New SqlCommand
Dim objRec As SqlDataReader
objConn.ConnectionString = "Server=sad2525;Database=PortalDocs;Uid=sa;Pwd=;"
objConn.Open()
objCmd.CommandText = "SELECT * FROM DocsOpenAggregate WHERE Library = '" & Me.d_Library & "' AND DocumentNumber = " & Me.d_DocumentNumber
objCmd.Connection = objConn
objRec = objCmd.ExecuteReader()
Do While objRec.Read() = True
Me.d_Name = objRec("Name")
Me.d_Author = objRec("Author")
Me.d_AuthorID = objRec("AuthorID")
Me.d_Category = objRec("Category")
Me.d_ClientName = objRec("ClientName")
Me.d_ClientNumber = objRec("ClientNumber")
Me.d_DateCreated = objRec("DateCreated")
Me.d_DocumentName = objRec("DocumentName")
Me.d_DocumentType = objRec("DocumentType")
Me.d_EnteredBy = objRec("EnteredBy")
Me.d_EnteredByID = objRec("EnteredByID")
Me.d_FolderID = objRec("FolderID")
Me.d_KEFlag = objRec("KEFlag")
Me.d_LastEdit = objRec("LastEdit")
Me.d_LastEditBy = objRec("LastEditBy")
Me.d_LastEditByID = objRec("LastEditByID")
Me.d_Maintainer = objRec("Maintainer")
Me.d_MaintainerID = objRec("MaintainerID")
Me.d_MatterName = objRec("MatterName")
Me.d_MatterNumber = objRec("MatterNumber")
Me.d_Practice = objRec("Practice")
Me.d_Description = objRec("Description")
Me.d_Version = objRec("Version")
Me.d_Path = objRec("Path")
Me.d_FileName = objRec("FileName")
Loop
objCmd = Nothing
If objRec.IsClosed = False Then objRec.Close()
objRec = Nothing
If objConn.State <> ConnectionState.Closed Then objConn.Close()
objConn = Nothing
End Sub
'If using DocFetch, this method returns a file path to the document in the backend repository.
Public Function GetDocument() As String Implements IDocument.GetDocument
m_logger.Log("Document.GetDocument called for " & Me.DocumentLocation)
Return Me.d_Path
End Function
'Returns the metadata information about this document.
Public Function GetMetaData(ByVal aFilter() As String) As DocumentMetaData Implements IDocument.GetMetaData
m_logger.Log("Document.GetMetaData called for " & DocumentLocation)
Dim DOnvp(23) As NamedValue
DOnvp(0) = New NamedValue("Author", Me.d_Author)
DOnvp(1) = New NamedValue("AuthorID", Me.d_AuthorID)
DOnvp(2) = New NamedValue("Category", Me.d_Category)
DOnvp(3) = New NamedValue("ClientName", Me.d_ClientName)
DOnvp(4) = New NamedValue("ClientNumber", Me.d_ClientNumber)
DOnvp(5) = New NamedValue("DateCreated", Me.d_DateCreated)
DOnvp(6) = New NamedValue("DocumentName", Me.d_DocumentName)
DOnvp(7) = New NamedValue("DocumentType", Me.d_DocumentType)
DOnvp(8) = New NamedValue("EnteredBy", Me.d_EnteredBy)
DOnvp(9) = New NamedValue("EnteredByID", Me.d_EnteredByID)
DOnvp(10) = New NamedValue("FolderID", Me.d_FolderID)
DOnvp(11) = New NamedValue("KEFlag", Me.d_KEFlag)
DOnvp(12) = New NamedValue("LastEdit", Me.d_LastEdit)
DOnvp(13) = New NamedValue("LastEditBy", Me.d_LastEditBy)
DOnvp(14) = New NamedValue("LastEditByID", Me.d_LastEditByID)
DOnvp(15) = New NamedValue("Maintainer", Me.d_Maintainer)
DOnvp(16) = New NamedValue("MaintainerID", Me.d_MaintainerID)
DOnvp(17) = New NamedValue("MatterName", Me.d_MatterName)
DOnvp(18) = New NamedValue("MatterNumber", Me.d_MatterNumber)
DOnvp(19) = New NamedValue("Practice", Me.d_Practice)
DOnvp(20) = New NamedValue("Description", Me.d_Description)
DOnvp(21) = New NamedValue("Version", Me.d_Version)
DOnvp(22) = New NamedValue("Path", Me.d_Path)
DOnvp(23) = New NamedValue("FileName", Me.d_FileName)
Dim metaData As New DocumentMetaData(DOnvp)
Dim strExt As String = Right(Me.d_FileName, Len(Me.d_FileName) - InStrRev(Me.d_FileName, "."))
Select Case LCase(strExt)
Case "xml"
metaData.ContentType = "text/xml"
metaData.ImageUUID = "{F8F6B82F-53C6-11D2-88B7-006008168DE5}"
Case "vsd"
metaData.ContentType = "application/vnd.visio"
metaData.ImageUUID = "{2CEEC472-7CF0-11d3-BB3A-00105ACE365C}"
Case "mpp"
metaData.ContentType = "application/vnd.ms-project"
metaData.ImageUUID = "{8D6D9F50-D512-11d3-8DB0-00C04FF44474}"
Case "pdf"
metaData.ContentType = "application/pdf"
metaData.ImageUUID = "{64FED895-D031-11D2-8909-006008168DE5}"
Case "doc"
metaData.ContentType = "application/msword"
metaData.ImageUUID = "{0C35DD71-6453-11D2-88C3-006008168DE5}"
Case "dot"
metaData.ContentType = "application/msword"
metaData.ImageUUID = "{0C35DD71-6453-11D2-88C3-006008168DE5}"
Case "rtf"
metaData.ContentType = "text/richtext"
metaData.ImageUUID = "{F8F6B82F-53C6-11D2-88B7-006008168DE5}"
Case "xls"
metaData.ContentType = "application/vnd.ms-excel"
metaData.ImageUUID = "{0C35DD72-6453-11D2-88C3-006008168DE5}"
Case "xlt"
metaData.ContentType = "application/vnd.ms-excel"
metaData.ImageUUID = "{0C35DD72-6453-11D2-88C3-006008168DE5}"
Case "pps"
metaData.ContentType = "application/vnd.ms-powerpoint"
metaData.ImageUUID = "{0C35DD73-6453-11D2-88C3-006008168DE5}"
Case "ppt"
metaData.ContentType = "application/vnd.ms-powerpoint"
metaData.ImageUUID = "{0C35DD73-6453-11D2-88C3-006008168DE5}"
Case "htm"
metaData.ContentType = "text/html"
metaData.ImageUUID = "{D2E2D5E0-84C9-11D2-A0C5-0060979C42D8}"
Case "html"
metaData.ContentType = "text/html"
metaData.ImageUUID = "{D2E2D5E0-84C9-11D2-A0C5-0060979C42D8}"
Case "asp"
metaData.ContentType = "text/plain"
metaData.ImageUUID = "{F8F6B82F-53C6-11D2-88B7-006008168DE5}"
Case "idq"
metaData.ContentType = "text/plain"
metaData.ImageUUID = "{F8F6B82F-53C6-11D2-88B7-006008168DE5}"
Case "txt"
metaData.ContentType = "text/plain"
metaData.ImageUUID = "{F8F6B82F-53C6-11D2-88B7-006008168DE5}"
Case "log"
metaData.ContentType = "text/plain"
metaData.ImageUUID = "{F8F6B82F-53C6-11D2-88B7-006008168DE5}"
Case "sql"
metaData.ContentType = "text/plain"
metaData.ImageUUID = "{F8F6B82F-53C6-11D2-88B7-006008168DE5}"
Case Else
metaData.ContentType = "application/octet-stream"
metaData.ImageUUID = "{F8F6B82F-53C6-11D2-88B7-006008168DE5}"
End Select
metaData.Name = Me.d_Name
metaData.Description = Me.d_Description
metaData.FileName = Me.d_FileName ' This is a file name - for example "2jd005_.DOC"
metaData.IndexingURL = Me.d_Path ' This is a file path - for example "\\fileserver01\docsd$\SF01\DOCS\MLS1\NONE\2jd005_.DOC"
metaData.ClickThroughURL = "http://mofoweb/docsopen.asp?Unique=" & HttpUtility.HtmlEncode(Me.DocumentLocation)
metaData.UseDocFetch = False
Return metaData
End Function
'Returns the signature or last-modified-date of this document that indicates to the portal whether the document needs refreshing.
Public Function GetDocumentSignature() As String Implements IDocument.GetDocumentSignature
Dim SigString As New StringBuilder
Dim SigEncode As String
SigString.Append(Me.d_DocumentNumber & "||")
SigString.Append(Me.d_Library & "||")
SigString.Append(Me.d_Name & "||")
SigString.Append(Me.d_Author & "||")
SigString.Append(Me.d_AuthorID & "||")
SigString.Append(Me.d_Category & "||")
SigString.Append(Me.d_ClientName & "||")
SigString.Append(Me.d_ClientNumber & "||")
SigString.Append(Me.d_DateCreated & "||")
SigString.Append(Me.d_DocumentName & "||")
SigString.Append(Me.d_DocumentType & "||")
SigString.Append(Me.d_EnteredBy & "||")
SigString.Append(Me.d_EnteredByID & "||")
SigString.Append(Me.d_FolderID & "||")
SigString.Append(Me.d_KEFlag & "||")
SigString.Append(Me.d_LastEdit & "||")
SigString.Append(Me.d_LastEditBy & "||")
SigString.Append(Me.d_LastEditByID & "||")
SigString.Append(Me.d_Maintainer & "||")
SigString.Append(Me.d_MaintainerID & "||")
SigString.Append(Me.d_MatterName & "||")
SigString.Append(Me.d_MatterNumber & "||")
SigString.Append(Me.d_Practice & "||")
SigString.Append(Me.d_Description & "||")
SigString.Append(Me.d_Version & "||")
SigString.Append(Me.d_Path & "||")
SigString.Append(Me.d_FileName & "||")
Dim encoding As New UTF8Encoding
Dim byteArray As Byte() = encoding.GetBytes(SigString.ToString())
SigEncode = System.Convert.ToBase64String(byteArray, 0, byteArray.Length)
Return SigEncode
End Function
'Returns an array of the users with access to this document.
Public Function GetUsers() As ACLEntry() Implements IDocument.GetUsers
'no acl info retrieved
Dim aclArray(-1) As ACLEntry
Return aclArray
End Function
'Returns an array of the groups with access to this document.
Public Function GetGroups() As ACLEntry() Implements IDocument.GetGroups
'no acl info retrieved
Dim aclArray(-1) As ACLEntry
Return aclArray
End Function
End Class
End Namespace1. I don't think you can just set the index url to a unc path.
2. Try creating an index aspx page. In your MetaData.IndexURL set it to the index aspx page, and include query string params for the encoded unc path as well as the content type.
3. In the index servlet, get the content type and path from the query string
4. Get the filename from the file path
5. Set the headers for content-type and Content-Disposition, e.g.
Response.ContentType="application/msword"
Response.AddHeader("Content-Disposition", "inline; filename'" + filename)
6. Stream out the file:
FileStream fs = new FileStream(path, FileMode.Open)
byte[] buffer = new byte[40000]
int result
System.IO.Stream output = Response.OutputStream
do
result = fs.Read(buffer, 0, 40000)
output.Write(buffer, 0, result)
while (result == 40000)
put the above in a try-catch, and then delete the temp file in the finally block.
If this does not help, set a breakpoint in the code to find the error. Also use Log4Net to log any errors. -
"object reference not set to an instance of an object" error while running ssrs report locally
Hi Folks,
I am a bit new to SSRS.
I am using ssrs 2012 and trying to use a method from a dll file. I am loaded the assembly file in reference of the report.
Now I am trying to use a static method from the Dll. e.g. applicationName.classname.MethodName()
But while running the report I am getting "object reference not set to an instance of an object" error.
For a note I am trying execute the report locally.
Any help would be highly appreciable.
sarat chandra sahooSorry for late reply Sinaloe..
I have added a dll file in my report reference. And in a textbox trying to execute this below.
=Recall.Common.LocalizationEx.Localization.GetString(Parameters!Culture.Value, "RFID", "BICustomerPortal")
where Getstring() is a static method in the dll.
I guess some configuration setting I am missing here.
1. I have copied these dlls in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies" and "C:\Windows\Assembly".
sarat chandra sahoo -
I'm running this command in the Azure PowerShell to deploy my node project as a service:
Publish-AzureServiceProject -ServiceName <name> -Location "East US"
Using my service name instead of <name>.
Each time I run this, I get an error:
Publish-AzureServiceProject : Object reference not set to an instance of an
object.
At line:1 char:1
+ Publish-AzureServiceProject -ServiceName <name> -Location "East US"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Publish-AzureServiceProject], N
ullReferenceException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.CloudService.Pub
lishAzureServiceProjectCommand
I have added my certificate and verified it with Get-AzureSubscription.
Can anyone help?When I run Get-AzureSubscription, the subscription already seems to be set. I assume this happened when I imported my publish settings. I tried your suggestion to do it manually, but this didn't fix my problem.
I've started implementing the deployment script linked in the blog post, but I'm running into all sorts of problems as I try to do so. First, this seems to assume I have a service package and publish settings. I'm guessing the package is going to need to
be generated for each deployment, but the script doesn't handle this. How can I also have the script generate the new package so that the service can be deployed? I've currently hard-coded the path of cspack into the script, but this seems like a bad way to
do it.
Since the publish settings have the certificate, I imagine I don't want to commit those to version control. Can I also generate this as part of the script? I want the script to be as hands-off as possible.
Thank you for your help! -
Object Reference Not Set To An Instance Of An Object - Outlook Add-In - Add-In Express
Hi,
My Add-In has been developed in VS2010 using the Add-In Express pack.
Its a very simple add-in that shows an IT support ticket email detailing PC information. To use it, following installing the add-in, the user must select the tab in outlook and click on the Send IT Support Email button which will generate an Outlook Email
Template with specific information about the PC that I pull using VB.
It works fine in Windows 7 & 8, but throws an 'Object Reference Not Set To An Instance Of An Object' exception in Windows XP. Screenshot is shown below:
The code is below
Imports System.Runtime.InteropServices
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports AddinExpress.MSO
Imports System.Object
Imports System.Net
Imports System.Environment
Imports System.Net.NetworkInformation
Imports System.Windows.Forms.Application
Imports Microsoft.Office.Interop.Outlook
Imports outlook = Microsoft.Office.Interop.Outlook
'Add-in Express Add-in Module
<GuidAttribute("735B7BC8-DD2F-44D8-BC37-30D86769C065"), ProgIdAttribute("$safeprojectname$.AddinModule")> _
Public Class AddinModule
Inherits AddinExpress.MSO.ADXAddinModule
#Region " Add-in Express automatic code "
'Required by Add-in Express - do not modify
'the methods within this region
Public Overrides Function GetContainer() As System.ComponentModel.IContainer
If components Is Nothing Then
components = New System.ComponentModel.Container
End If
GetContainer = components
End Function
<ComRegisterFunctionAttribute()> _
Public Shared Sub AddinRegister(ByVal t As Type)
AddinExpress.MSO.ADXAddinModule.ADXRegister(t)
End Sub
<ComUnregisterFunctionAttribute()> _
Public Shared Sub AddinUnregister(ByVal t As Type)
AddinExpress.MSO.ADXAddinModule.ADXUnregister(t)
End Sub
Public Overrides Sub UninstallControls()
MyBase.UninstallControls()
End Sub
#End Region
Public Shared Shadows ReadOnly Property CurrentInstance() As AddinModule
Get
Return CType(AddinExpress.MSO.ADXAddinModule.CurrentInstance, AddinModule)
End Get
End Property
Private Sub AddInModule_AddInInitiatize(ByVal sender As Object, ByVal e As EventArgs) _
Handles MyBase.AddinInitialize
'Outlook 2010 = 14
If Me.HostMajorVersion >= 14 Then
AdxOlExplorerCommandBar1.UseForRibbon = False
End If
End Sub
Public ReadOnly Property OutlookApp() As Outlook._Application
Get
Return CType(HostApplication, Outlook._Application)
End Get
End Property
'Gets the MAC Address from the NIC Information
Function getMacAddress()
Dim nics() As NetworkInterface = _
NetworkInterface.GetAllNetworkInterfaces
Return nics(0).GetPhysicalAddress.ToString
End Function
Sub CreateTemplate()
Dim sHostName As String
Dim sDomain As String
Dim sUserName As String
Dim sOS As String
Dim s64 As String
Dim sMAC As String
Dim host As String = System.Net.Dns.GetHostName()
Dim LocalHostaddress As String = System.Net.Dns.GetHostEntry(host).AddressList(1).ToString()
Dim MyItem As Outlook.MailItem
'Finds the PC Number
sHostName = Environ$("computername")
'Finds the Domain
sDomain = Environ$("userdomain")
'Finds the Username logged into the PC
sUserName = (Environment.UserDomainName & "\" & Environment.UserName)
'Finds the Operating System
sOS = (My.Computer.Info.OSFullName)
'Shows the results collected from the getMacAddress Function in the sMac variable
sMAC = getMacAddress()
'Finds the Architecture of the Operating System - x86 or x64
If (Environment.Is64BitOperatingSystem) Then
s64 = ("64bit")
Else
s64 = ("32bit")
End If
'Creates a Template Email
MyItem = OutlookApp.CreateItem(Outlook.OlItemType.olMailItem)
'Configures the Sender as [email protected]
MyItem.To = "[email protected]"
'Shows the template
MyItem.Display()
'Shows all of the string in the Email Body
MyItem.HTMLBody = String.Concat("<b><u>IT SUPPORT TICKET</u></b>", "<br/><br/>", "<tr><b>PC Number: </b></tr>", sDomain, "\", sHostName, "<b></b>", "<br/><br/>", "<b>Username: </b>", sUserName, "<b></b>", "<br/><br/>", "<b>OS Version: </b>", sOS, s64, "<b></b>", "<br/><br/>", "<b>IP Address: </b>", LocalHostaddress, "<b></b>", "<br/><br/>", "<b>MAC Address: </b>", sMAC, "<b></b>", "<br/><br/>", "<b>Comment:</b>", "<br/>", "<i>Please give a brief description of your problem attaching a screen shot if possible</i>", "<br/><br/>") & MyItem.HTMLBody
End Sub
Private Sub AdxRibbonButton1_OnClick(ByVal sender As Object, ByVal control As IRibbonControl, ByVal pressed As Boolean) Handles AdxRibbonButton1.OnClick
'Runs CreateTemplate
CreateTemplate()
End Sub
Private Sub AdxCommandBarButton1_Click(ByVal sender As Object) Handles AdxCommandBarButton1.Click
'Runs CreateTemplate
CreateTemplate()
End Sub
End Class
I would appreciate any help with this whatsoever as I am pulling my hair out!!
Many Thanks!!
ChrisHi,
Welcome to MSDN forum.
I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
and Visual Studio Editor.
Because your Add-in is developed using Add-in Express which is third-party, I suggest consulting Add-in Express forum:
http://www.add-in-express.com/forum/index.php for better support.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
"Object reference not set to an instance of an object" when using Sheel Shah's example
I am attempting to use a custom add dialog as in http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx and
I get the error "Object reference not set to an instance of an object." when clicking my button to AddEntity(). My code to call the control is:
User u = new User();
userdialoghelper.AddEntity(u);
Any ideas as to why I'm getting this error? I "think" that I've set up the class properly?
ScottI may be a couple of years late to the party here (using VS2013) but I also had some issues adapting to Yann's improvements over Sheel's code.
Sheel's screen code as provided has the word "Old in the InitializeDataWorkspace and the created methods. this does not work when copy/pasted. ALso removed the "UI" from "InitialiseUI()"
Following code can be used with Yann's Helper Class.
Namespace LightSwitchApplication
Public Class EditableCustomersGrid
Private customersDialogHelper As ModalWindow
Private Sub EditableCustomersGrid_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
customersDialogHelper = New ModalWindow(Me.Customers, "CustomerViewDialog")
End Sub
Private Sub EditableCustomersGrid_Created()
customersDialogHelper.Initialise()
End Sub
Private Sub gridAddAndEditNew_CanExecute(ByRef result As Boolean)
customersDialogHelper.CanAdd()
End Sub
Private Sub gridAddAndEditNew_Execute()
customersDialogHelper.AddEntity()
End Sub
Private Sub gridEditSelected_CanExecute(ByRef result As Boolean)
customersDialogHelper.CanView()
End Sub
Private Sub gridEditSelected_Execute()
customersDialogHelper.ViewEntity()
End Sub
Private Sub EditDialogOk_Execute()
customersDialogHelper.DialogOk()
End Sub
Private Sub EditDialogCancel_Execute()
customersDialogHelper.DialogCancel()
End Sub
End Class
End Namespace -
I have a csv file that I need to generate a schema for. I am trying to generate a schema using flat file schema wizard but I keep getting "Object reference not set to an instance of an object." error when I am clicking on the Next button after
specifying properties of the child elements on the wizard. At the end I get schema file generated but it contains an empty root record with no child elements.
I thought may be this is because I didn't have my project checked out from the Visual SourceSafe db first but I tried again with the project checked out and got the same error.
I also tried creating a brand new project and generating a schema for it but got the same error.
I am not sure what is causing Null Reference exception to be thrown and there is nothing in the Windows event log that would tell me more about the problem.
I am using Visual Studio 2008 for my BizTalk development.
I would appreciate if some has any insides on this issue.Hi,
To test your environment, create a new BizTalk project outside of source control.
Create a simple csv file on the file system.
Name,City,State
Bob,New York,NY
Use the Flat file schema Wizard to create the flat file schema from your simple csv instance.
Validate the schema.
Test the schema using your csv instance.
This will help you determine if everything is ok with you environment.
Thanks,
William -
Object Reference Not Set error using CrystalReportViewer
I have a web application in which I am attempting to use the CrystalReportViewer. Using Visual Studio 2008, I was able to get the viewer to run and display reports just fine. But since I moved to Visual Studio 2010, I've been unable to get it working again. I reinstalled Crystal Reports for Visual Studio 2010 and the x64 runtime. I created a test aspx page with just the following content:
using CrystalDecisions.Web;
public partial class Test : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
CrystalReportViewer Viewer = new CrystalReportViewer();
Viewer.ID = "viewer";
ph.Controls.Add( Viewer );
When I load the page, I get this exception:
NullReferenceException: Object reference not set to an instance of an object.
CrystalDecisions.Web.ViewerGlobal.get_IsNetscape6Up() +88
CrystalDecisions.Web.CrystalReportViewer.Render(HtmlTextWriter output) +83
This is a server-side exception, so I'm pretty sure that my browser has nothing to do with it, but I've tried this in both Chrome and IE8.
Do I have a screwy install? Or is there something I'm neglecting to do to configure the ReportViewer that's new in 2010?
Thanks for your help,
-SteveI figured it out.
I had already tried adding a new aspx page as David suggested before, and that did not work. So this time I made a whole new "ASP.NET Crystal Reports Web Site" project in my solution, which was nice enough to make a default aspx page with a built in crystal report viewer tied to a new report .rpt file in the project. And believe it or not, it worked flawlessly.
The use of CrystalReportViewer was different but relatively equivalent in both cases. So then I started analyzing the differences between this new project's web.config and mine. After some painstaking troubleshooting, I determined the problem: someone on my team had added some new content to the web.config, which included these lines:
<system.webServer>
<modules>
<remove name="Detector" />
<add name="Detector" type="FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation"/>
</modules>
</system.webServer>
I'm assuming that Crystal also uses a module called "Detector" in get_IsNetscape6Up(), and that this code was overriding that module.
It's still not working quite right, but at least I'm past this error and on to the next one.
I appreciate the help, Don and David!
Thanks,
-Steve -
Hi All,
When we do a test-outlookconnectivity -protocol:http the result is a success but then we get the following:
ClientAccessServer ServiceEndpoint Scenario
Result Latency
(MS)
xxxxxxxxxxxx... xxxxxxxxxxxxxx Autodiscover: Web service request. Success 46.80
WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance
of an object.
Object reference not set to an instance of an object.
+ CategoryInfo : NotSpecified: (:) [Test-OutlookConnectivity], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Exchange.Monitoring.TestOutlookConnectivityTask
So it looks like it's not completing successfully.
I can't find anything on this in particular, and don't really know how to go about solving it - We are fully up to date, Exchange 2010 Sp2 with Rollup 5-v2
Any help appreciated!hi,
I have the same issue also on Exchange 2010 SP2 RU5v2
I ran your command and get the below
[PS] C:\Installs\report\Activesync>Test-OutlookConnectivity -Protocol:http |FL
RunspaceId : ebd2c626-1634-40ad-a17e-c9a713d1a62b
ServiceEndpoint : autodiscover.domain.com
Id : Autodiscover
ClientAccessServer : CAS01.domain.com
Scenario : Autodiscover: Web service request.
ScenarioDescription :
PerformanceCounterName :
Result : Success
Error :
UserName : Gazpromuk.intra\extest_645e41faa55f4
StartTime : 8/21/2013 4:08:50 PM
Latency : 00:00:00.1250048
EventType : Success
LatencyInMillisecondsString : 125.00
Identity :
IsValid : True
WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance of an object.
Object reference not set to an instance of an object.
+ CategoryInfo : NotSpecified: (:) [Test-OutlookConnectivity], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Exchange.Monitoring.TestOutlookConnectivityTask
Any help would be greatly appreciated, I also get random failures of OWA, EAS and web services, very frustrating
I have no errors in the app event log
thanks
Faisal Saleem Windows Systems Analyst 07595781867 -
Hello.
I just installed a new farm, the wizard was succesfull in all steps. However when I try to load the default site it created I got this exception.
Any idea?
System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties() at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs()
at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext) at Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalAvailable() at Microsoft.Office.Server.WebControls.MyLinksRibbon.EnsureMySiteUrls()
at Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalMySiteUrlAvailable() at Microsoft.Office.Server.WebControls.MyLinksRibbon.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Control.LoadRecu...
Follow me on Twitter <<<I tried removing the user profile service application and creating it again, when I did that, and tried to navigate to the page to manager the user profile application it shows me an exception
According to the uls log viewer its;
Microsoft.Office.Server.UserProfiles.UserProfileApplicationNotAvailableException: This User Profile Application's connection is currently not available. The Application Pool or User Profile Service may not have been started. Please contact your administrator.
at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.ProfileAdminPage.get_CurrentApplicationProxy() at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.ProfileAdminPage.IsProfileSynchronizationRunning() at Microsoft.SharePoint.Portal.WebControls.UserProfileServiceImportStatisticsWebPart.RenderSectionContents(HtmlTextWriter
writer) at Microsoft.SharePoint.Portal.WebControls.UserProfileServiceImportStatisticsWebPart.RenderWebPart(HtmlTextWriter writer) at Microsoft.SharePoint.WebPartPages.WebPart.Render(HtmlTextWriter ...
I checked and the sharepoint web services default was stopped, I started and still the same error, that pool is under Local Service account.
Follow me on Twitter <<<
Maybe you are looking for
-
How can I use 2 iPhone 4's on same iTunes account, but NOT sync same contacts?
How can I use 2 iPhone 4's on same iTunes account, but NOT sync same contacts?
-
I upgraded to Windows 8.1 and now I can't access Remote Desktop
I work for a large mortgage company and work remotely from time to time. I use Windows Secure Application Manager. I just upgraded from Window 8 to 8.1 a couple of days ago and now, when I try to login, I'm receiving a message stating that "Your brow
-
Lync with Microsoft Project 2013
Hi, I have Microsoft Lync 2013 and Microsoft Project 2013. Can anyone send me the steps to integrate these two so that i can get the updates from the team members without leaving Microsoft Project? K.Gokulraj
-
Homehub 3 - wifi dropping only when PC on
Over the past week when my PC is on (connected to HH3 via Ethernet cable), the devices in the house which connect via wifi (an ipad an 2 iphones) seem to keep dropping wifi connectivety. When the PC is off though , the devices keep hold of the wifi c
-
Hi, Before I upgraded to Mountain Lion, whenever I opened an App that wasn't permanently on the dock, it's icon would appear on the dock temporarily when the app was open. Now, when I open an App