This Was a Most Unpleasant Surprise

Posted on 2007/05/30 by Randall.
Categories: Uncategorized.

For whatever reason, IE7 has a problem with session cookies for URLs containing an underscore. You can tweak the privacy options anyway you like but it will not matter.

The workaround, if you’re not a domain administrator, is to use Firefox.

Fuckerstick.

Update: This is actually caused by the enhanced-security IE configuration that is out-of-the-box on Windows 2003 servers. I added the site to my Trusted Sites and now the menus work just fine.

What’s up with ProfileCommon in MOSS 2007?

Posted on by Randall.
Categories: Uncategorized.

Really. I don’t understand why, but anytime I try to make use of this.Profile in my MOSS2007-hosted user-control, it is turning up as null. I’m not sure if this is supported inside of Sharepoint or not. I mean, it’s a plain old aspnet website so I don’t see why it wouldn’t be supported….

Update: I just had to add some XML to the <httpModules> section of the sharepoint site’s web.config.

Smart Part Is Alright With Me

Posted on 2007/05/23 by Randall.
Categories: Uncategorized.

Today I am working on getting a user control which I have built up onto our Sharepoint server. I wasn’t sure if I should just take apart the user control and rebuild it as a webpart, or if I should just try out this SmartPart thingy and load in my user control through it. There’s apparently a performance hit doing it this way, but you also get to avoid all the webpart headaches…such as adding every motherfucking server control into the webpart’s control tree using code.

So far so good. I had a little hitch when trying to install smartpart, because the documentation lists the control’s version as 1.0.0.0 when it is actually 1.1.0.0. So using Reflector I figured this out and updated the SafeControl entry in my web.config. I was able to load in a hello world user control and am presently working on getting my frankenstein spaghetti monster user control to load up inside the smart part wrapper.

Where Is the Calendar In Sharepoint

Posted on 2007/05/22 by Randall.
Categories: Uncategorized.

I created a new Basic Meeting Site in sharepoint. I was thinking that this would be the template to create a site with a calendar of events. Not so. I didn’t find anything even vaguely resembling a calendar here.

So I went with the Application Templates -> Event Planning site template. This is exactly what I had in mind. A few weird things in these pages which I’d rather not have appear to the end users, but wtf this gets me 80% of the way there.

Strong Named Assemblies

Posted on 2007/05/21 by Randall.
Categories: Uncategorized.

Here’s a link to some more info on strong names for dotnet assemblies. This is all new to me but these instructions were real easy to follow.

Most of my bookmarks for more dotnet & sharepoint info can be found here:
Dotnet
and
Sharepoint

User Controls vs. Web Parts

Posted on by Randall.
Categories: Uncategorized.

Let me again state for the record that I don’t know what I’m doing. The only hope I hold out is that I know I can RTFM like nobody else can. It looks like I’ve got a lotta reading to do in order to catch up.

I’m working on installing some aspnet components on our Sharepoint dev server. Right off the bat I will point out that you cannot really put anything into the sharepoint web root and expect to see it in a browser. It seems like a security constraint they’ve put up which prevents me from doing this. So maybe the next best thing is to just create another app underneath the sharepoint app. At least, this is what I’m trying out right now. I am able to get things to run but I just encountered a very strange error message that goes a little like this:

System.Security.SecurityException: Request for the permission of type ‘System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed.

Probably because what I am doing is so very wrong. Any of you knuckleheads out there know what to do about this?

Speaking of very very wrong things, ask me about what I did on Friday night…

Update: I think that I was able to work my way out of this problem by adding in some attributes to a class file. It might have been something resembling this. Or it may have started working when I dropped my DLL into the GAC. Either way I am facing this issue once more and will try to make note of the solution to the problem here.

Meh…that didn’t seem to fix anything. Trying the GAC install technique instead…

GAC installation did not help things either!!! In order to do this you drop your .dll file into c:\windows\assembly and then you add in a line of XML to your web.config file, in the section like this:



Update Again: If you think that changing your web.config’s
element from
to
, you would be fucking wrong.

I’ve also tried to setup some custom code access levels in the .NET Config Wizard. This didn’t fix anything.

I broke down and made a windows application which calls my test dll. This seems to indicate that this inability to make DB calls from the dll is a problem exclusive to the web application. It might be a sharepoint thing or not. My next test is to make a plain vanilla webapp and try calling the dll from there.

It worked. So I know now that there’s no inherent inability to do this kind of operation. I guess it’s something to do with sharepoint, or the web.config of my sharepoint application. I don’t know which yet, but I am going to try to find out.

I am looking at the WSS policy files right now…I set the
element in web.config to WSS_Medium for both the public-facing fba site and the internal win-nt sites and still no luck. I will try to give permissions in SQL Mgmt Console to the WSS_WPG and see if this helps. It seems like this works. It’s one of these users, IUSR_<machine_name>, IIS_WPG, or WSS_WPG…going to find out which one thru divide & conquer…it looks like the winner is IUSR_<machine_name>.

I’m glad that is over with. But it didn’t end just yet…

I changed the web.config to reset the trust level to WSS_Minimal and this got me into trouble again. I also removed my DLL from the GAC, but it seems to be fine with that, so long as you’ve got the DLL specified in your web.config it will look for the file in /bin and load it up. But you cannot make this kind of sql call through the smartpart->user control with the trust level set at WSS_Minimal, you must use WSS_Medium.

Forms Based Authentication

Posted on by Randall.
Categories: Uncategorized.

I had a lot of trouble setting up forms based authentication on my sharepoint dev server. Most of the troubles were in IIS, just getting the domain name and host headers and IP addresses all lined up correctly. You basically setup your aspnet membership/profile database the way you do with any other aspnet website, and then you point sharepoint at the database and tell it to use forms authentication.

But once you do this your new user is not granted permission to use the sharepoint site. You need to go in through the sharepoint central admin tool and set the new user to be a Site Collection Administrator. This is the last step that allows you to login to the sharepoint site under forms based authentication. The instructions here are pretty helpful, even though this particular article deals with dual authentication. It seems like you need to be an admin on the domain controller in order to achieve this dual authentication setup.

But who needs it anyway?

Such a Pain in the Ass

Posted on 2007/05/10 by Randall.
Categories: Uncategorized.

When trying to pull in another document using an iframe with an aspx page to set the content-disposition header and shove the bytes down the freaking pipe:

An error occurred during the processing of /Search/set_header.aspx. Code blocks are not allowed in this file.

Update: The solution to this problem is to create a block of XML in your web application’s web.config file resembling the following:


<PageParserPaths>
<PageParserPath VirtualPath="/pages/test.aspx"
   CompilationMode="Always" AllowServerSideScript="true" />
</PageParserPaths>

It works like a charm but most bastard admins are going to make you explain why they should take such a “risk”. Is it a risk? I don’t know. That VirtualPath property will take wildcards, but as it is now pointing to a single page I’m not so sure this is a real security issue. I suppose that would depend on how well you’ve locked down the file and directory. (more…)

Back to Sharepoint, After These Messages…

Posted on 2007/05/09 by Randall.
Categories: Uncategorized.

I am so motherfucking sick and tired of this job. Maybe if there were one success I’d be happier. Or if I could somehow change my view on the projects in the past, and see those past projects as successes rather than as failures. That would help me a little bit, but there’s also this aspect of the job where there is very little person-to-person contact. Now don’t get me wrong, I can’t stand people but yeah sometimes you need to hang out and shoot the shit. Prattle on…prattle on…

I’m trying to redesign the search results page from Sharepoint 2007 to make it so that it will show a document preview next to the search results. Wish me luck! I’ve seen the source for that page now and I can tell you it is hella complicated.

Lots of New Ground Covered Today

Posted on 2007/05/04 by Randall.
Categories: Uncategorized.

I just started using the debugger to step through my SQLExpress stored procedures. That gives me nerd wood. You have to enable it in the project properties, and then go in thru the server explorer tab to drill down to the stored proc. From there you can choose “Step Into Stored Procedure” and so long as you’re not connected using the SQLExpress Manager tool-thingy it should work. It’s a little bit useless for some purposes but it is handy for others. Way too easy to use.

I’ve now also used the new aspnet profile framework to easily add personalization to the site in a generic way. It’s all managed through the web.config file and is pretty handy.