I am working on visual web parts. I created a sharepoint project in VS2010 and added one visual web part to it.Built this and deployed.I am able to see the web part added and I can drag that to any page on site.
Now I created a new solution redirecting to same site (site to which first solution was pointing). Added one visual web part to it.Built this and deployed too.now when I see the site though I can add this new webpart to the page but the webpart added from previous solution are throwing error.
Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type TestWebPart1.Testwebpart.Testwebpart, TestWebPart1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=02dc69d4b9065085 could not be found or it is not registered as safe.
Looks Like I can not work with more than one solution for a single site. May I get the reason for this?
This usually means your webparts assembly isn't registered among the safecontrols in the sharepoint web.config OR that you didn't create a strongly typed assembly
To register in safecontrols
To fix open your web.config located in the iis root site of your sharepoint server, usual path is something like
c:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config
Add the following in the <SafeControls> section
<SafeControl Assembly="TestWebPart1.Testwebpart.Testwebpart, TestWebPart1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=02dc69d4b9065085" Namespace="TestWebPart1" TypeName="*" Safe="True" AllowRemoteDesigner="True" />
Signing assemblies
http://msdn.microsoft.com/en-us/library/ms247123(v=vs.80).aspx
I'm not sure if it's the case but; here's an theory:
You may have created the webparts with the same namespace and name but within different solutions.
So what is going on is; the first solution gives the webpart's binary a unique id like "1" and the other one is giving "2" for instance.
So the first deployed web part's binary is overwritten with the binary with Id = "2" since they have the same names, but the unique Id of the binary is the newer one's id.
So the first one's controls are looking for a binary with Id = "1" and cannot find it.
That may be the error you're receiving.
You've got to change the names.
If this is the case, let me know and I'll add some comments on the naming conventions you can use.
Its not very clear what you are trying to achieve.
But you can have as many solution as you want for a site. There is no 1 solution restriction
Related
I have used Intellegencia UrlRewriter for a while now.
I used it with VB class that looks up the product Name and gets the relevant ID number to use for the querystring.
It works great.
How can I do the same thing in Umbraco?
I have thought of 1 way:
To use url structure of ~/products/product_name/ (which is really ~/products/product.aspx?id=XX) and add ~/products/* as a reserved folder and basically take this entire page out of Umbraco.
The problem is that my client would like the site structure to be ~/product_name/ (not in a subfolder). My problem is that I don't think I have any way to tell Umbraco not to handle these pages.
Can anyone help me?
You can inform umbraco to ignore paths with the following appSettings key in your web.config:
<appSettings>
....
<add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/product_name/" />
This key is included in the web.config by default so you can search umbracoReservedPaths and you will find it. Simply add your path and umbraco will ignore it. You may also specify individual pages with the umbracoReservedUrls appSetting key.
Of note, you will see that in the /config/ folder there is a UrlRewritting.config for the urlrewritting.net rewritter already integrated into your umbraco install.
I'm creating an app that will be configurable by the end-user to access SharePoint lists, on various different SharePoint sites, that are entered by the user.
All of the examples for reading SharePoint lists I've come across online are of the form:
Open or create a Visual Studio
project.
In Solution Explorer,
right-click the References node, and
then click Add Service Reference.
In the Address box, type the URL to
the target site and append
/_vti_bin/ListData.svc. For example,
the address for the site
intranet.wingtip.com would be
http://intranet.wingtip.com/_vti_bin/ListData.svc.
Change the default name in the
Namespace box from ServiceReference1
to something more appropriate, such
as WingtipSite.
etc, etc, etc
This method creates proxy classes within your project based on the specified server reference. However, in my case, the server/site is not known at design time, only runtime by reading the sites/lists specified by the user. How would one go about doing that (reading the list via http://intranet.wingtip.com/_vti_bin/ListData.svc, but at runtime only)?
Note: I am making this call from a different machine than the one running Sharepoint.
There are a couple answers.
If the lists schemas will be consistent across all the sites you are querying, you can still use the generated proxy. When you create the DataContext, you just need to pass in the URI to the ListData.svc for the site chosen by the user.
If not, then you can use an ASP.NET WebRequest with an appropriately formatted URI and parse out the ATOM or JSON response that comes back.
For more information on using the REST APIs, check out this talk from the 2009 SharePoint Conference
http://msdn.microsoft.com/en-us/sharepoint/ff462048
You can set the URL in your proxy class at runtime with the Url property.
SharePoint does not provide a proxy class for their web services. Therefore it's not possible to set the url at runtime. WHat I have had to do is add 2 service references and then paramaterize which one I will access. I use a config setting to determine which one to access. If the site name changes or list changes, then I need to remove the references, re-add them, recompile and redeploy. There is no way to change the SharePoint site/list at runtime. Have been searching for 3 days for an answer. Microsoft does not know how to accomplish this.
I need to be able to deploy bunch of aspx files when a site (sub-site aka web) is provisioned. I added a feature but it seems whole feature thing has changed with vs 2010 or sp2010. I am totally lost. All I want to do is to deploy these pages when a web is provisioned. Is it possible?
You can't drop aspx pages into SharePoint per say. If you want to add functionality, some of the options are:
1) Using Web Parts - probably the most popular method
2) User Controls
At the end of the day, you will create it as a Feature using VSeWSS 3.0 in VS and packaging/deploying it as a solution. Steer clear of trying to hack this up in SharePoint Designer - for one, you won't have source control like you have with a Feature.
http://www.andrewconnell.com/blog/articles/UsingCodeBehindFilesInSharePointSites.aspx
http://www.codersbarn.com/?tag=/webpart
I have a Search web reference (from a Search Server 2010 express install) in a vb.net application that is utilizing the QueryService Class to search a production Sharepoint foundation 2010 site.
At a previous point in time, we had created a proof of concept on an entirely test system that has since been turfed. From my recollection on this test system when documents were uploaded as a specific site content type (that inherits from document) and metadata was provided, we could search for specific metadata by making managed properties for each, and search results would be returned as documents (with the isdocument flag set to true). Viewing the document then became simple, as we could simply use the filename and path to display the stored file.
Now we are developing a production system and we have encountered a new behavior, where these results now are returned as aspx results such as
http://digitizaton/Company/Client Documents/Forms/DispForm.aspx?ID=1703
This of course makes it terribly difficult to locate and view the document, we can extract the Title which will then give us the name of the file with no extension, but that hardly helps, as the FileExtension data is aspx, not the documents file extension, so we don't have a full filename. We could display the page returned as a result, but would much prefer the document itself.
I've made a test document library, with just bare bones setup, (not using the site content type, or site columns) and uploaded some documents on the same site, and they are returned in the same fashion, so I don't believe the document library, or content type are the issue.
With a fairly limited understanding of both Sharepoint and Search Server, I don't know if this is a setup issue with the search service itself, with the site configuration, or with the querypacket I am sending. We also have a third party application (Knowledgelake) installed on the server that ties into sharepoint which could have changed configuration somewhere as well?
I don't think the query packet has changed since it was working in the proof of concept, other than the custom data column names. I will provide it here in case there is something glaringly obvious to an external reader.
<QueryPacket xmlns='urn:Microsoft.Search.Query.Document'>"
<Query>
<SupportedFormats>
<Format>urn:Microsoft.Search.Response</Format>
</SupportedFormats>
<Range>
<Count>0</Count>
</Range>
<Context>
<QueryText type='MSSQLFT'>
SELECT Filename, Title, FileExtension, IsDocument, Path from Scope() WHERE ""Scope"" = 'Department1' AND CustomData = 'X' --
</QueryText>
</Context>
Any guidance would be incredibly appreciated. If I have not provided some relevant information, please let me know and I can track it down.
Thanks everyone
So now I feel like an idiot, I've searched for hours with no luck, and literally seconds after composing this post, I find the nugget of gold I've been searching for.
It appears that our primary file type, PDF, has a known issue with Sharepoint 2010, as shown at the following site.
http://www.sharepointsharon.com/2010/03/sharepoint-2010-and-adobe-pdf/
and further to that, this registry entry setting is required to link it all together
http://www.mossgurus.com/adnan/Lists/Categories/Category.aspx?Name=SharePoint%202010%20--%20Configuration
We have inherited a vb.net 2003 web project, it seems to reference another web site. I am not sure how this was done. I cannot delete the reference (there is no properties and will not respond to pressing the delete key).
The reference looks like a folder with a pic of the world on it. Any ideas how to get rid of it?
Thanks
In this case I don't believe you're referencing another web site. Instead you're using a website which has a nested web site located under it. This is a representation of IIS's internal structure and I don't believe you can change it via visual studio. You'd have to delete the website in IIS.
Is there a WebRefrences folder in SolutionExplorer (you may have to click Show All Files).
If so - you can delete the refrence there but you should check the all the code in the project (global search) to see if the code refrences the WebRefrence first.