UPnP device host service often begins using 25% of CPU indefinitely (fully uses single core)
Restarting service helps for some time.
What may be the cause of this problem? What features depend on this service (I want to disable it)?
P.S. By the way, this problem is hunting me since Vista Beta from time to time. On different computers.
Reply:
------------------------------------
Shut down problem
s.s.
Reply:
This question is more appropriate for the Windows Answers Forum at the following address
http://answers.microsoft.com/en-us/windows
That file should belong to the software Quick Heal Total Security: maybe you could contact the software's manufacturer and ask for support.
Bye.
Luigi Bruno - Microsoft Community Contributor 2011 Award
------------------------------------
DHCPV6 not giving out addresses - where to start?
I have a test server (virtual network), on which I have the DHCP role installed and configured. I have set up both IPV4 and IPV6 scopes, and activated them.
Now, my client only picks up the IPV4 DHCP address from the server, but does not get any IPV6 information. The only IPV6 address configured on the client is the link-local address.
Does anyone have any hints as to find out what the problem might be?
Grant Ward, a.k.a. Bigteddy
What's new in Powershell 3.0 (Technet Wiki)
Network Live Audit - Powershell script- Changed type Bigteddy Wednesday, February 1, 2012 5:49 PM No resolution found
Reply:
In reality you need to configure the client (Windows Vista/Windows 7) to obtain DHCPv6 addresses. By default Vista and W7 have the following configuration:
Router Discovery : enabled
Managed Address Configuration : disabled
Other Stateful Configuration : disabled
It means it will get IPv6 addresses generated based on IPv6 Router Discovery. That means even if you configure a Stateful DHCPv6 the client will not obtain any address until you ajust the configuration to:
Router Discovery : disabled
Managed Address Configuration : enabled <== This allows client to obtain IPv6 from DHCPv6
Other Stateful Configuration : enabled <= This allow the client to obtain DHCPv6 Options
You have to run netsh commands as shown in KB 961433:
How to configure a Windows Vista client to obtain an IPv6 DHCP address
http://support.microsoft.com/kb/961433
Daniel Mauser
------------------------------------
Reply:
A few questions:
1) what server OS
2) what client OS
3) on server, what is the output of:
a) 'netsh int ipv6 sh int'
b) 'netsh int ipv6 sh int <ind-number>'
(probably the number of the "Local Area Connection" interface)
c) 'netsh int ipv6 sh route'
-------
Just this week I have setup a similar environment in my lab (W2K8-R2 & Win7 Ent, running on VMware Workstation 7.1.5, with both VMclients pointing to the local VMnet interface).
I had the exact same scenario as you have, client would not get DHCPv6 addr.
I did not make any changes to the client, but the server required the following:
a) netsh int ipv6 set int interface=<idx#> for=ena advertise=ena advertisedef=ena store=per
b) rerun the 'netsh int ipv6 sh int <idx#>', verify "managed" and "other" are still enabled, if not, you may need to run this command:
'netsh int ipv6 set int interface=<idx#> man=ena oth=ena
[one time it all looked ok on the server but client still didn't get its DHCPv6 addr, so I rebooted the server, set the man and oth flags again (as they were now disabled), then the client got its DHCPv6 addr.]
c) netsh int ipv6 add route prefix=::/0 interface=<idnx#> publish=no
without the above command, my client would not set its def g/w being the on-link server link-local, and would therefore not be able to ping the server global unicast addr.
--------
The issue I saw (via Wireshark) was the server was not sending a Router Adevrtisement after the client asked for one. After making the first set of changes, I started getting the RAs, but the client was not setting its def g/w until I added the static route in the server.
--------
Now the client has link-local and global unicast (via DHCPv6) IPv6 addresses, no other IPv6 addresses (this is expected result).
The procedure above is what worked for me and I was able to re-produce it a number of times.
After I got one network working, I setup a second network in the server and at this time I actually have 2 network interfaces in 2 different VMnets, multiple IPv4 & IPv6 scopes, and each VMnet has a client. Each client gets a DHCP/DHCPv6 addr and pings all work across the interfaces on the server, client-to-client.
hth...Jeff
PS, let us know if you get it working, and what you did to get there :-)
Jeff Carrell
------------------------------------
Reply:
Thanks for both your replies. I first tried adjusting the client, as described in the kb article, but this didn't work. So then I tried the server-side commands, and they all completed successfully. However, from my client (another 2008 Server), this is the result I get:
C:\Users\administrator>ipconfig /renew6 Windows IP Configuration An error occurred while renewing interface Local Area Connection : The semaphore timeout period has expired.
Grant Ward, a.k.a. Bigteddy
What's new in Powershell 3.0 (Technet Wiki)
Network Live Audit - Powershell script------------------------------------
Reply:
Glad the server side notes helped :-) I assume that meant your client received a DHCPv6 addr ?
Hmm on the W2K8 interface...I have found that sometimes ipconfig /renew or renew6 does not work to well.
Try disable/enable on the interface (via GUI) or simply unplug/replug the Ethernet cable.
hth...Jeff
Jeff Carrell
------------------------------------
Reply:
Glad the server side notes helped :-) I assume that meant your client received a DHCPv6 addr ?
Hmm on the W2K8 interface...I have found that sometimes ipconfig /renew or renew6 does not work to well.
Try disable/enable on the interface (via GUI) or simply unplug/replug the Ethernet cable.
hth...Jeff
Jeff Carrell
They didn't help. My client is still not receiving Site-Local addresses from the DHCP Server. As I said, I followed the steps to enable the DHCPV6 client, and the DHCPV6 Server, but I have had NO successs.
Grant Ward, a.k.a. Bigteddy
What's new in Powershell 3.0 (Technet Wiki)
Network Live Audit - Powershell script------------------------------------
Reply:
I have never made any changes to a client, but I also can't say what would happen if making the changes as posted from the kb article on a client.
Can you post the output of the following commands from the server:
a) 'netsh int ipv6 sh int <idx-number>'
(probably the number of the "Local Area Connection" interface,
can be derived by running 'netsh int pv6 sh int')
b) 'netsh int ipv6 sh route'
I will be back in my lab in a bit, and I'll post some info on what specific pkts you should see in sequence between the client and the server for ICMPv6 & DHCPv6. You can run Wireshark and see what your computers are doing.
I'll also change a client as ref in the kb to see what happens.
back soon...Jeff
Jeff Carrell
------------------------------------
Reply:
Here is a scrn shot of the pkt flow between the client and srvr for ICMPv6/DHCPv6.
I disable/enable the clients interface, then the client starts with an RS (pkt 2763), the srvr replies with an RA (pkt 2765), then the client sends the DHCPv6 Confirm (pkt 2783) [the very first time a client will send a DHCPv6 Solicit and the DHCPv6 srvr will reply to that, my client had an IPv6 addr before, so it tries to get the same addr again by asking for a confirm] and srvr replies with DHCPv6 Reply (pkt 2788), then client asks for DHCPv6 Renew (pkt 2820) and srvr replies with DHCPv6 Reply (pkt 2821).
There are some NS/NA in-between for DAD checks, etc.
Then I could ping from client to srvr on the srvr DNS name, to its global unicast addr.
hth...Jeff
Jeff Carrell
------------------------------------
Reply:
a) 'netsh int ipv6 sh int <idx-number>'
(can be derived by running 'netsh int pv6 sh int')
It will help to see both "server" and "client" current configs on their IPv6 portion on the interfaces.
Thanx...Jeff
Jeff Carrell
------------------------------------
Reply:
Following that kb, I just set a Win7 client with:
netsh int ipv6 set int [index] routerdiscovery=disabled
netsh int ipv6 set int [index] managedaddress=enabled
netsh int ipv6 set int [index] otherstateful=enabled
then I disabled/enabled the interface.
I rec'd a DHCPv6 address, but the default gateway for IPv6 did not get set, as expected since the client was told not to send an RS, and therefore doesn't see RAs and has no way to get def g/w.
When I netsh int ipv6 set int [index] routerdiscovery=enabled, disable/enable the interface, got the DHCPv6 addr and the def g/w was set to the servers link-local addr as expected.
btw2, I just loaded up a Vista ULT SP2 client, and its default state is the "router, managed, other" all "enabled", just like my Win7 SP1 clients are. That is why I've never made any config changes to the clients.
Changes in DHCPv6 operations are generally made by the "router" advertisements (my initial email for the W2K8-R2 srvr acting like a router for DHCPv6 purpose) as those control the network side...the controlling flags are "A", "L", "M", "O".
hth...Jeff
Jeff Carrell
------------------------------------
Reply:
I've been pondering a bit of my description in the last post I had, and I wanted to make a slight clarification.
The W2K8-R2 srvr is acting like a router, from the standpoint it is sending RAs, with only the M and O flags set, and it also supplies an ICMPv6 option type of "Source link-layer address", which is what allows the clients to set their def g/w to the srvr (router in the case) link-local addr. The client sends a NS with the link-layer of the srvr looking for its link-local in the NA from the srvr.
hth...Jeff
Jeff Carrell
------------------------------------
Reply:
Thanks to all who posted here. I really had no idea that IPv6 DHCP would be so complex and difficult! It's really not that important, I just thought I was doing something basic wrong.
So, let's call it quits, and move on. Thanks again.
Grant Ward, a.k.a. Bigteddy
What's new in Powershell 3.0 (Technet Wiki)
Network Live Audit - Powershell script------------------------------------
Reply:
IPv6 is "not that hard" (only from one who has been playing with for awhile now), but it is definitely different :-)
I would be happy to continue working with you on this if you have interest, online or offline...I also had to make a slight change in my VMware/real computer network interface setup to get it working....I haven't tried HyperV.........I guess I will need to mock this up in HyperV for my own knowledge now :-)
The key in IPv6 address autoconfiguration, there is a "router" function and/or a "DHCPv6" required if you want more than the Link-Local address...and that's what I am using the W2K8-R2 server for - both functions...it can work.
Anyway, you got me to try a few things, and for that I thank you :-) I'm all about learning new stuff!
Regards...Jeff
Jeff Carrell
------------------------------------
Three-state workflow issue
Hi Friends,
I am stuck with the three-state workflow process in the following situation:
I have created a three-state workflow wherein when user 1 creates an item in a discussion board, it is automatically redirected to his manager, User B, who is the reviewer and once B approves it, it then goes to C for final approval. But the requirement here is there are 10 users who have different managers (reviewers) and the final approver is the same, user C; how should I go about creating the workflows for these different managers (reviewers) in the same discussion board?
Reply:
Here's a potential solution if you don't already have one (perhaps someone has a better idea). Note: This solution makes the following assumptions: 1) you are using the built-in three-state workflow; 2) the manager field within Active Directory is being utilized and has been imported into the user profile store; and 3) you have installed the "Useful SharePoint Designer Custom Activities" found on CodePlex: http://spdactivities.codeplex.com/.
Here's my thought:
- Create a new column in your discussion board. The column should be of type Person or Group. For the sake of these instructions I will call the column ManagedBy, but you can name it whatever you want.
- Configure your out-of-the-box three-state workflow to be started manually (uncheck the other "automatic" options). Also, configure the three-state workflow to use the new ManagedBy column for the "reviewer" in your scenario above.
- In SharePoint designer, create a new workflow. The workflow should be configured to start automatically when an item is added to the list.
- The first thing you'll probably want to do in the new workflow is wait until the item is checked in (Wait for Change in Document Check-out Status action).
- Next, you'll populate the new ManagedBy column using the Lookup Manager of a User action. Then take the value returned and assign it to the ManagedBy column.
- Use the Start Another Workflow action to kickoff your three-state workflow.
Well, there it is. Hope it helps.
------------------------------------
How to Install AntiSpam Agents in Exchange 2010 - Steps for Beginners
How to Install AntiSpam Agents in Exchange 2010 for Beginners
Experts Please Excuse -
http://careexchange.in/how-to-install-antispam-agents-in-exchange-2010/
Satheshwaran Manoharan | Exchange 2003/2007/2010 | Blog:http://www.careexchange.in
- Edited by Satheshwaran ManoharanMVP Wednesday, February 1, 2012 4:41 PM
When does a HEAD request succeed for a BLOB being uploaded?
I am trying to identify we're able to verify an image exists in Azure storage via FetchAttributes, but then subsequently the file is missing from the container. I can say, there is no process that is deleting content from the container... we are only uploading to it.
After an image is uploaded, we peform a blob.FetchAttributes() to confirm it's existence in Azure and mark the result in the DB. Sometimes, we notice images that are missing, but the database confirms the process marked it as being successfully loaded and verified in Azure.
I believe it may be a concurrency issue with our application. We have a windows service that polls a database table for a list of images to upload to Azure (sometimes many thousand at a time). It loads those records into an in-memory queue, which X-number of worker threads have access to when processing the individual records. If the queue is very long, subsequent polling of the DB for unprocessed records may result in duplicate records being appended to the queue. Since the workers do not re-upload images if they already exist in Azure, this duplciation is tolerated.
Because we see the images missing sporadically, I'm wondering what Azure would do if 2 separate threads were to upload the same blob (image file) at the same time. Could there ever be a condition where a FetchAttributes would return successfully without having the blob actually committed to Azure?
Obviously, we are working to resolve our concurrency issue to prevent the possibility of 2 threads working on the same file at the same time. But right now, this is just a theory, and knowing how Azure handles a condition like this might give us confidence in any fix we implement.
Thanks in advance for any response.
Reply:
------------------------------------
Reply:
I would tend to agree... but what if the 2 threads start to upload the blob concurrently, and after the 1st thread completed, the 2nd thread subsequently failed. Would this yeild a result where the blob exists in Azure for a brief moment, but then is removed from the container because the 2nd thread of execution did not complete it's upload?
------------------------------------
Inserting zip file into SQL DB in hex format giving error
Hi , I am archiving zip file into SQL DB by using WCF-SQL Adapter, Its working fine but in some scenarios its giving below error. A message sent to adapter "WCF-SQL" on send port "ArchieveSubmissionZip" with URI "mssql://idr36354//DB?" is suspended. Error details: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The input data for the field/parameter "parm1" is invalid according to the expected SqlDbType VarBinary. ---> System.FormatException: Invalid length for a Base-64 char array. at System.Convert.FromBase64String(String s) at Microsoft.Adapters.Sql.MetadataHelper.ConvertXmlValueToDotNetObject(String xmlString, String fieldParameterName, SqlDbType sqlDbType, Int32 maxLength, Int32 precision) --- End of inner exception stack trace --- Server stack trace: at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) Thanks, Chandra
Reply:
From the error message, it looks like the length of your message might be the issue.
Are you able to resend the same message again to see if it is failing every time? Check the maximum length of your SQL column for the binary data against the length of your message data.
I did a bit more research and found many references to the data length to be evenly divisible by 4. You might consider opening up a case with Microsoft and have them investigate.
Are you sending the data signed or encrypted? If so, just send the raw zipped data without any encoding.
David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.
- Edited by David K. Downing Wednesday, February 1, 2012 3:17 AM Additional information
------------------------------------
Reply:
I am not sending encrypted data, its raw zip file, I am using in SQL varbinary (max) data type in table to store zip file and its working ,I stored 54 kb zipped file and 11 kb also ,and it failed for 33 kb zipped file ,So I am trying to understand what is the problem here.
------------------------------------
Reply:
From the research I've found by doing a search on Bing (link below), it seems likely that your issue is a bug in the WCF-SQL adapter or the inner processing within BizTalk. Raw data is raw data and if you are not operating on the data, the issue must be in the processes that are transmitting the data.
You should consider opening up a support case with your Microsoft representative. Make sure you include the 33 kb zipped file if it reproduces the issue each time.
David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.
------------------------------------
Site Simple URL Lync
Reply:
What error are you seeing when you attempt to add the new simple URLs?
Are you seeing the error when you apply the new simple URLs to the simple URL configuration for the site?
Justin Morris | Consultant | Modality Systems
Lync Blog - www.justin-morris.net
Twitter: @jm_deluxe
If this post has been useful please click the green arrow to the left or click "Propose as answer"
------------------------------------
Reply:
This is the error
Set-CsSimpleUrlConfiguration : Object reference not set to an instance of an ob
ject.
At line:1 char:29
+ Set-CsSimpleUrlConfiguration <<<< -Identity "site:<site>" -SimpleUrl @{Ad
d=$simpleUrl3}
+ CategoryInfo : NotSpecified: (:) [Set-CsSimpleUrlConfiguration]
, NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Rtc.Mana
gement.Internal.SetSimpleUrlConfigurationCmdlet
------------------------------------
Reply:
Justin Morris | Consultant | Modality Systems
Lync Blog - www.justin-morris.net
Twitter: @jm_deluxe
If this post has been useful please click the green arrow to the left or click "Propose as answer"
------------------------------------
Copy document to a document set
Hi,
I have a document library where users can upload a document. When they do that a document set is created in another library (with SPD workflow). Now I want to create a workflow that would copy the document from the first library to the created document set in the second library. I've managed to copy the document to another library:
SPListItem item = workflowProperties.Item;
string libName = "destinationLibrary";
using (SPSite site = new SPSite("destinationURL"))
{
using (SPWeb web = site.OpenWeb())
{
if (item.File != null)
{
SPFolder library = web.Folders[libName];
library.Files.Add(
item.Name, item.File.OpenBinary());
library.Update();
}
}
}
How can I copy the document to a document set? The document set should have the same name as the document title.
Sandra
Sandra Ratis
Reply:
Hi,
I've managed to create a workflow that creates in library B a document set and then moves the file from library A to the created document set in Library B. Now I have the problem with Content types that are available to this Document Set have been added or removed. And even if I click on the Update the document set nothing happens. I added the code for the docset_LastRefresh that i found here but it doesn't help.
SPSite myDestinationSite = new SPSite("http://server/");
SPWeb myDestinationWeb = myDestinationSite.OpenWeb();
SPList myDestinationList = myDestinationWeb.Lists["LibraryB"];
//the document name
SPListItem sourceItem = workflowProperties.Item;
string SourceNaslov = sourceItem["Name"].ToString();
//substring file extension from the filename
int index = SourceNaslov.LastIndexOf(".");
string SourceNaslov1 = SourceNaslov.Substring(0, index);
SPContentType docsetCT = myDestinationList.ContentTypes["Document Set"];
Hashtable properties = new Hashtable();
properties.Add("DocumentSetDescription", "New Document Set");
SPFolder parentFolder = myDestinationList.RootFolder;
//create the document set with the name of the document
DocumentSet mydocSet = DocumentSet.Create(parentFolder, SourceNaslov1, docsetCT.Id, properties, true);
SPSite mySourceSite = new SPSite("http://server/");
SPWeb mySourceWeb = mySourceSite.OpenWeb();
SPList mySourceList = mySourceWeb.Lists["LibraryA"];
//get the file
SPFile file = mySourceWeb.GetFile("http://server/LibraryA/" + SourceNaslov);
string destinationFolderUrl = mydocSet.Folder.Url;
destinationFolderUrl = (!destinationFolderUrl.EndsWith("/")) ? destinationFolderUrl + "/" : destinationFolderUrl;
file.MoveTo(destinationFolderUrl + file.Name, true);
mySourceWeb.Update();
//update the docset_lastRefresh
SPFolder ds = myDestinationWeb.GetFolder("http://server/LibraryB/" + SourceNaslov1);
ds.Item.Properties["docset_LastRefresh"] = SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.UtcNow);
ds.Item.SystemUpdate(false);
Can someone tell me what am I doing wrong?
Sandra
Sandra Ratis
------------------------------------
Connect my Office DC to a remote DC server R2
I have a Dc in Islamabad and another Dc in Karachi i want to connet them?
Please help me out
Sorry for not good english
Regards S.Fahim
manutd
Reply:
Hi Fahim,
Thanks for posting here.
At first we need to connect both sites with each other by crossing internet with setting a VPN site to site connection , this can be done by using RRAS feature in Windows Server or VPN solutions form third party :
Common Remote Access Scenarios
http://technet.microsoft.com/en-us/library/dd469830.aspx
Branch Office over the Internet
http://technet.microsoft.com/en-us/library/cc736396(WS.10).aspx
We can also apply a dedicate line between to sites form ISP, however that may will cost more spending.
Once connection is up then we can have domain controllers and DNS servers at each site with setting AD sites and replication to support this active directory system between different locations:
Understanding Sites and Replication
http://technet.microsoft.com/en-us/library/cc757232(WS.10).aspx
Sites Sites Everywhere…
http://blogs.technet.com/b/askds/archive/2011/04/29/sites-sites-everywhere.aspx
Thanks.
Tiger Li
Tiger Li
TechNet Community Support
------------------------------------
Reply:
Hello Tiger Li
Thanks for replying here is the issue i have two forest who are remotely present i want to connect them, ok.
Do i have to first follow the above way to connect those two offices.
After connection how do i connect those forest, make thier trust.
Regards S.Fahim
manutd
------------------------------------
Reply:
Hi Fahim,
Thanks for update.
Yes , connection between sites over internet is required .
Once connection is created we should configure name resolution in order to create trust relationship, for the detail explanations please refer to the replies in the thread below:
Thanks.
Tiger Li
Tiger Li
TechNet Community Support
------------------------------------
Reply:
Hello Tiger Li
Ok i will let you know as i am doing this a a test requirement.
Thank You for your quick reply.
I will continue you with you over in here in the same post
Regards S.Fahim
manutd
------------------------------------
GFI MailArchiver - Oulook 2007 connector
Hi,
I will also post this in a GFI forum, but i thought i would ask it here too.
We have Exchange 2010 with all out clients running office 2007. We have GFI MailArchiver installed.
It was working fine until we went over our licensed user quota. I have since removed enough uneeded mail boxes and GFI is functioning again.
The issue i have is that there are a number of staff were the GFI toolbar icon is greyed out. To remedy this they have to go to 'File > Data file mamangement > add > and add GFI MailArchiver'.
Is there a way in exchange to enforce this to be done automatically as i cant have all my clients forever checking their GFI status.
Regards,
Kevin Bennett
Kevin Bennett
Managed Metadata Service Permissions and AD Account deletion
We have a SharePoint 2010 farm with a Managed Metadata Service configure. The original setup of this service was made by an Administrator who left us soon after. Our company policy is once an employee leave, his Active Directory Account is deleted.
Because this Administrator was the creator of the Managed Metadata Service, his AD account was put in the Connection Permissions (Permissions button in the Application Services). Once is account was deleted in AD, the Application Services page stop working and an error was displayed that an Active Directory Account or a Group is missing.
At this point, we didn't know the problem was with the Managed Metadata Service Connection Permissions. We only knew the change made was deleting this Admin account in AD. So we knew this AD account was configure somewhere in the Application Services, but we didn't have any clue where it be. And since the Application Services Page stop working, we were unable to look in the configuration of each service.
We tried PowerShell, no much luck either. The PowerShell cmdlet return the same error. Even deleting services wasn’t working in PowerShell.
We tried to recreate the account in AD, but because the Account SID was different, it didn’t work.
Reinstalling SharePoint was out of the question. So we decided to look in the SharePoint Databases. Our thinking was if SharePoint need the AD Account SID, it probably stored it somewhere. So we looked in each Application Services Database. We found some reference of this Account but no SID. So we look in the SharePoint Config Database. And in the Objects table Properties column, we found the Account and the SID. We backed up the Database before doing any modification. The Properties column contains data in an XML format. We removed the reference of this account and save the modification. The Application Services page started working again.
I just want to let you know. I know it’s not a support action to mess up with the database, but it saved us to reinstall the SharePoint 2010 Farm.
Francois Lessard
Reply:
SharePoint Solution Architect, Developer
------------------------------------
Reply:
I'm working through a similar problem right now. From what I can tell, the problem isn't that there's no access - it seems that if a "bad" account gets into the security for a service application, there's an unhandled exception that won't let you at the security page. What's worse is that it's looking like the same exception eats powershell applets - going into the database may be the only solution.
[Edit] Ended up rebuilding the farm - there was no recovering from it.
Philo
Philo Janus, MCP Author: Pro InfoPath 2007 Pro PerformancePoint 2007 Pro SQL Server Analysis Services 2008 Building Integrated Business Intelligence Solutions with SQL Server 2008 R2 & Office 2010 Blog @ http://philo.typepad.com/with-all-due-respect/
- Edited by Philo Janus Monday, February 6, 2012 7:11 AM
------------------------------------
How to mole SPField of Type "SPFieldUser' in SharePoint
Hi, Im writing unit test case for my SP app using Moles...currently Im stuck up with the implementation of
SPField moling.
I need to test the below code..
SPList list = web.Lists[ALERT_CONFIGURATION_LIST];
list.Update();
list.Fields.Add("Subscriber", SPFieldType.User, true);
list.Fields.Add("Topic", SPFieldType.Text, false);
list.Update();
web.Update();
SPField subfield = list.Fields["Subscriber"];
SPFieldUser userfield = (SPFieldUser)subfield; //line causing error
I'm able to mole list,web, listfields etc.. but when I encounter the line
SPFieldUser userfield = (SPFieldUser)subfield; Im getting the below error
"IvalidCastException, Unable to cast object of type 'Microsoft.SharePoint.SPField' to type 'Microsoft.SharePoint.SPFieldUser'."
Any clue on it?
Reply:
"T" | My blog updates | My Twitter | Our Products | Mail Me | LinkedIn | My Virtual Business Card
A THOUGHT ABOUT MY WORKPLACE :)
------------------------------------
Reply:
SharePoint 2010 PowerShell
------------------------------------
Reply:
What are you trying to implement. If you want to fetch value of some User type field in a list then you can do something like below
SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Subscriber");
SPFieldUserValue userValue = (SPFieldUserValue)userField.GetFieldValue(item["Subscriber"].ToString());
SPUser user = userValue.User;
Not sure what is the exact requirement so it would be helpful if you can elaborate.
------------------------------------
Reply:
hi im trying to write unit test case using Pex and Moles for the above piece of code..
Somehow Im not able to mock the above line properly...
Original code
public void AddList(SPWeb web)
{
using (web)
{
//Creates 'AlertConfiguration' custom List using Custom List template
SPListTemplate listTemplate = web.ListTemplates["Custom List"];
web.Lists.Add(ALERT_CONFIGURATION_LIST, "It containt Alert Content Type", listTemplate);
web.Update();
SPList list = web.Lists[ALERT_CONFIGURATION_LIST];
list.Update();
list.Fields.Add("Subscriber", SPFieldType.User, true);
list.Fields.Add("Topic", SPFieldType.Text, false);
list.Update();
web.Update();
SPField subfield = list.Fields["Subscriber"];
SPFieldUser userfield = (SPFieldUser)subfield;
userfield.SelectionGroup = web.Groups["Focal Points"].ID;
userfield.Update();
subfield.Update();
list.Update();
//Adds the column to the default view
SPView defaultView = list.Views["All Items"];
defaultView.ViewFields.Add(list.Fields["Subscriber"]);
defaultView.ViewFields.Add(list.Fields["Topic"]);
defaultView.Update();
}
}
Related Unit test case
[TestMethod]
[PexMethod]
[HostType("Moles")]
public void TestListWebPartWithBehaviors()
{
string fieldName = "Subscriber";
bool required;
MSPSite.BehaveAsNotImplemented();
BSPListCollection lists = new BSPListCollection();
BSPList objList = new BSPList();
//objList.InstanceBehavior = BehavedBehaviors.
BSPField objFieldSub = new BSPField();
objFieldSub.Title = "Subscriber";
objFieldSub.Type = SPFieldType.User;
objFieldSub.Required = true;
BSPField objFieldTopic = new BSPField();
objFieldTopic.Title = "Topic";
objFieldTopic.Type = Microsoft.SharePoint.SPFieldType.Text;
objFieldTopic.Required = true;
objList.Fields.SetAll(new[] { objFieldSub, objFieldTopic });
lists.SetAll(new[] { objList });
MSPListTemplate custTempalte = new MSPListTemplate();
MSPListTemplateCollection templates = new MSPListTemplateCollection();
templates.ItemGetString = (name) => custTempalte;
MSPWeb web = new MSPWeb();
web.Dispose = () => { };
web.ListTemplatesGet = () => templates;
web.ListsGet = () => lists;
web.Update = () => { };
Feature2EventReceiver receiver = new Feature2EventReceiver();
receiver.AddList(web);
}
When I run the , "Pex Explorataions", Im getting the invalid case exception mentioned above...
------------------------------------
Reply:
instead of this
SPField subfield = list.Fields["Subscriber"];
SPFieldUser userfield = (SPFieldUser)subfield;
Try
SPFieldUser userfield = list.Fields.GetField("field displayname") as SPFieldUser;
"T" | My blog updates | My Twitter | Our Products | Mail Me | LinkedIn | My Virtual Business Card
A THOUGHT ABOUT MY WORKPLACE :)
------------------------------------
hi
i feel great to join this forum.
Excel 2003
I would like something like a drop down box with a list above a certain column.
when an item on that list is selected, i would like a column from a different sheet to be inserted into the column below the drop down box.
Is this achievable ?
look forward to your reply
thank you
Very Important
Thank you
Mohamed Ahmed
Reply:
------------------------------------
Display drivers issue
Hi, could advise on an error I am getting around - VGA display issues on client machines after developing a five application an image.
Please help.
Reply:
Kent Agerlund | My blogs: blog.coretech.dk/kea and SCUG.dk/ | Twitter: @Agerlund | Linkedin: Kent Agerlund
------------------------------------
Reply:
My Microsoft Core Infrastructure & Systems Management blog - blog.danovich.com.au
------------------------------------
Microsoft RDS and Microsoft with citrix xen desktop
Hi,
What type of desktop delivery methods are supported with Microsoft alone and when we have with Citrix xendesktop?
Regards,
Reply:
I am not sure if you question is related with Lync VDI support?
If this is the case, you can refer to "Client virtualization support for the Lync 2010 client and the Lync 2010 Group Chat client".
------------------------------------
Reply:
Microsoft has a KB article detailing the support provided:
"Client virtualization support for the Lync 2010 client and the Lync 2010 Group Chat client" http://support.microsoft.com/kb/2560826
If you are using it in a published desktop environment, your mileage will vary depending on all of the usual variables, but issues surrounding those are questions best left for a different group:
- the client and server hardware
- client and server versions/patching
- how Citrix/Hyper-V/App-V/RDS is configured
With a published/streaming application environment, you will get essentially the Lync Standard CAL features.
------------------------------------
iTunes Quit Recognizing Outlook 2010
- Changed type Max Meng Thursday, January 5, 2012 1:29 PM 3rd-party product issue
Reply:
------------------------------------
Reply:
Are you using 32 or 64bit Outlook? Do you know when it quit working? If you can identify a date and have a restore point, try restoring to before that point.
Diane Poremsky [MVP - Outlook]
Outlook Daily Tips | Outlook & Exchange Solutions Center
Subscribe to Exchange Messaging Outlook weekly newsletter
------------------------------------
Reply:
My PC is 64 bit.
I've done some more digging since I sent in my question, and I realized the problem occurred right after I installed & ran System Mechanic (iolo product). I found on an Apple forum that several other people have the same problem, so I called iolo's customer service. They talked with me a while and tired a simple fix -- which didn't fix it, so they requested a copy of my set-up log files and a system snapshot so they can determine the cause. As soon as I hear back, I'll post their response.
They're great to work with and if you also use System Mechanic, you may want to contact iolo too, so they can look into a software tweak for iTunes/PC users.
Stay tuned.....
Gratefully Yours, Linda
------------------------------------
Reply:
------------------------------------
Reply:
Linda,
I don't know if you resolved your issue yet but I had the exact problem. Windows 7, iphone, Outlook 2010, Iolo. I resolved it by doing a repair on Office 2010 through Programs and Features. Took about 8-10min.
Ernie
PC Rescue Tech
Spring, Tx
------------------------------------
Reply:
Ernie, thanks so much for your reply. I actually tried repairing Office, and it worked - until System Mechanic ran again. Then it was the same old thing. After reading the trials & tribs others were having on the Apple Support Community site, I ended up canceling System Mechanic. I tried several things suggested by others on that site, and nothing I tried worked. Apparently that was the case for a lot of the other folks, too. I did hear that a System Mechanic upgrade fixed the problem (cost involved), but I'm now pretty leery about messing with the registry again.
Best wishes & thanks for the suggestion!
Gratefully Yours, Linda
------------------------------------
pocket excel will no longer display excel 2002 spreadsheets
Since my excel 2002 on my laptop was updated to SP3, my iPAQ 1910 will no longer display spreadsheets. I am running pocket pc version 3.0.11171.
What is needed to get the spreadsheets to display again? Right now every spreadsheet now shows "this sheet is a placeholder for and unsupported sheet type."
This happens to every spreadsheet that the laptop opens then is updated through microsoft ActiveSync to the iPAC.
Reply:
RPA
------------------------------------
No comments:
Post a Comment