I recently started doing tests with SharePoint and I reached the point where I needed doing my own WebPart and debug it. I read about setting a development environment for WSS 3.0 in The .NET Addict's Blog: Setting up your SharePoint 2007 Development Environment. Summing up (changing slightly his suggestions), I needed a spare computer or virtual machine to:
- Install Server 2003 R2, with IIS, SP2 and updates
- Install an instance of SQL Server 2005 Standard Edition
- Install Microsoft .NET Framework 3.0 Redistributable Package
- Install Microsoft Windows SharePoint Services 3.0 with Service Pack 1 (WSS3.0SP1) not in standalone mode.
- Install Visual Studio 2005 and Service Pack 1
- Install Microsoft Windows SharePoint Services 3.0: Software Development Kit (SDK)
- Install Microsoft Windows SharePoint Services 3.0 Tools Visual Studio 2005 Extensions
- Install Microsoft Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation)
After a couple of days I had the virtual environment ready and tried to create my very first Web Part using the Web Part template installed in the previous steps: I just removed a comment so that the Web Part returned "Output HTML":
public class Web_Part1 : System.Web.UI.WebControls.WebParts.WebPart { public Web_Part1() { this.ExportMode = WebPartExportMode.All; } protected override void Render(HtmlTextWriter writer) { // TODO: add custom rendering code here. writer.Write("Output HTML"); } }
Compiled, tried to deploy... and the following error appeared:
Creating solution ... System.ArgumentException Illegal characters in path.
No more information, no trace in the EventLog, nor any other log. What path? What character(s)?
I googled for this problem and found a a page that finally drove me in the right direction:
In System.ArgumentException: Illegal characters in path, they talk about Latin characters (my native Operating System, VS2005 and WSS3.0SP1 are Spanish too). They suggest using encoding iso-8859-1 instead of UTF-8 in XML files... but since those files are created by the tools extension add-in (not mine) I could not manage to do any changes there. But they were right in pinpointing that character outside the standard ASCII character set range of 0x00 - 0x7F might be causing the problem.
Even thought his problems were related to a WebService, the idea of the extended characters was interesting. However, none of my files had any of those. I even re-created the simple project and solution right beneath the root C:\ and the problem still appeared: Illegal characters in path.
After some hours I changed the perspective. If VS2005 cannot tell me which file/path has illegal characters, let's do other tool tell me: Process Monitor. For those of you that do not know this tool, Process Monitor is an advanced monitoring tool for Windows that shows real-time file system, Registry and process/thread activity.
I started Process Monitor, filtered by process name devenv.exe (Visual Studio) and tried to do a deploy. Of course it failed again, but then I changed to Process Monitor window and started to scroll and read.
After some minutes I found it! VS2005 was trying to create some files at a temporary directory, pointed by both TMP and TEMP environment variables. They were set to: C:\Documents and settings\myusername\Configuración local\Temp
There was the extended character ó in Configuración. This directory in English systems is: C:\Documents and settings\myusername\Local settings\Temp
After knowing that, all I had to do is changing the user environment variables TMP (and TEMP, just in case) to any other directory not containing any special characters, C:\TEMP for instance. You can do it right clicking on My PC, Properties, Advanced options, Environment variables button, and modify...
I then restarted VS2005 and everything was compiled and deployed without any problem.
Keywords: Visual Studio 2005, VS2005, deploy, WSS3.0, Sharepoint Services, Web Part, development, error, solution, illegal characters in path, caracteres no válidos en la ruta de acceso, implementar
19 comments:
Thanks a lot, your information was very useful.
It really work.
Great!
You are the best.
Thanks a lot.
You are the Man,
Fucking Monster, brilliant.
You saved my ass, thanks a lot.
Muchas gracias!!! Yo tenia exactamente el mismo problema. La info es de mucha utilidad!
Thank you!!!!
Спасибо. Все заработало... Целый день парился.
Thank you!!! All working.
Great article! It saved my OS from reinstalling!
Thank You!
thank you for this article. this information was very useful.
Eres grande!!
You are tall!!
Que magoooo, gracias amigo.
De veras, muchas muchas gracias por tu ayuda
Thank you very very much.
Thank you very much! Your post saved a lot of my time!
Gracias hermano!!! sos un maestro.
Thank you very much! It was exactly my problem!
Great! Thanks a lot))
From Ukraine
Спасибо! :)
Great!
Спасибо
Post a Comment