Tuesday, March 15, 2011

The language-neutral solution package was not found

Error occurred in deployment step 'Retract Solution': The language-neutral solution package was not found

So today I was working on a Workflow in SharePoint2010 with VS2010. I had deployed and retracted several times while debugging this workflow. When all of a sudden I get this error that makes no sense at all. "The language-neutral solution package was not found" I got this if I was either deploying or retracting the solution. After some digging and playing with power shell I got it to work.

Steps:
  1. Right Click the solution and select Package
  2. Open SharePoint Power Management Shell
  3. Use the following Command: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue"
  4. Then use : Add-SPSolution -LiteralPath "[PATH and FileName].wsp" -Confirm:$false
  5. Now go back to VS2101 and you will be able to retract the solution since you have added a solution back into SharePoint.

Wednesday, October 13, 2010

Runtime newer than Currently Loaded

Failure adding Assembly to the cache: The assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

So, today I was building a reporting application with DevExpress Xtrabase Report Suite. (So far great reporting tool). Building it on my machine with VS 2010 and .net Framework 4.0. Everything worked well on my machine. So now comes time to deploy to Development box. Development box is running IIS 6 with .Net Framework 2.0. When I ran the GacUtil tool I received the above error. After some digging I found that I either had to do one of two things. Install .Net Framework 4.0 or recompile my application in .Net Framework 2.0 - 3.5. So since I wasn't using anything specific to 4.0 and I didn't want to spend all day installing software, i opted to just change the properties of my application to build in 3.5. Copied to the dev server and reran the GacUtil and Bajinga... everything worked...

Sunday, October 10, 2010

Point WCF .Svc file to Assembly in the GAC

Separating .SVC file from the WCF code

There are times when you want to package up all your web services into a dll and install in into the GAC. I had to do this on one of my recent Sharepoint/ Silverlight applications. I needed to install the the .SVC file in the Layouts directory of Sharepoint, but I didn't want all the other code there. So i performed the following steps.

  1. Created an Interface for my service and created my service.
  2. Created a .SVC file and stored it into the WebPart project in the 12/Templates/Layouts directory.
  3. Update the .SVC file to point to your Assembly and Service namespace.



Now when you call your service URL http://..../service.svc it will reference the .dll in the GAC

Thursday, September 9, 2010

IIS Timeout While Debugging

A co-worker sent this to me and I wanted to keep it in my notes for future reference.


Taken from:

http://msdn.microsoft.com/en-us/library/bb763108(VS.90).aspx

The debugger stopped execution of code on the Web site. This caused Internet Information Services (IIS) to assume that the worker process stopped responding. Therefore, IIS terminated the worker process.

To continue to debug, you must configure IIS to allow the worker process to continue. This error message does not appear with versions of IIS that are older than IIS 7.

To configure IIS to allow the worker process to continue

  1. Open the Administrative Tools window.

    1. Click Start, and then choose Control Panel.

    2. In Control Panel, choose Switch to Classic View, if necessary, and then double-click Administrative Tools.

  2. In the Administrative Tools window, double-click Internet Information Services (IIS) Manager.

    IIS Manager opens.

  3. In the Connections pane, expand the node if necessary.

  4. Under the node, right-click Application Pools.

  5. In the Application Pools list, right-click the name of the pool your application runs in, and then click Advanced Settings.

  6. In the Advanced Settings dialog box, locate the Process Model section, and perform one of the following actions:

    • Set Ping Enabled to False.

    • Set Ping Maximum Response Time to a value that is larger than 90 seconds.

    Setting Ping Enabled to False stops IIS from checking whether the worker process is still running and keeps the worker process alive until you stop your debugged process. SettingPing Maximum Response Time to a large value allows IIS to continue monitoring the worker process.

  7. Click OK to close the Advanced Settings dialog box.

  8. Close IIS Manager and the Administrative Tools window.

Monday, January 4, 2010

SQL Server DataTypes

I found this information on another site listed below and thought it was really good information that I wanted to keep in my notes:


The Types of Data

After deciding on the name of a column, the database needs to know the kind of information the column will hold. Since there are various kinds of information a database can deal with, SQL Server provides a set of categories called data types. Therefore, you must specify the data type that is necessary for a particular column. The data types used on a table are the same as those we reviewed for the variables:

bit: The bit is the smallest data type of the SQL Server categories of columns. It is used for a field that would validate a piece of information as being true or false, On or Off, Yes or No, 1 or 0.

int: An integer, also called a natural number, or a whole number, is a number that can start with a + or a - sign and is made of digits. Between the digits, no character other than a digit is allowed. When the number starts with +, such as +44 or +8025, such a number is referred to as positive and you should omit the starting + sign; this means that the number should be written as 44 or 8025. Any number that starts with + or simply a digit is considered as greater than 0 or positive. A positive integer is also referred to (in the programming world) as unsigned. On the other hand, a number that starts with a - symbol is referred to as negative. If a column would hold numbers in the range of -2,147,483,648 to 2,147,483,647, set its data type as int.

tinyint: If you except to use very small numbers such as student's ages, or the number of pages of a brochure or newspaper, apply the tinyint data type to such a field. A column with the tinyint data number can hold positive numbers that range from 0 to 255.

smallint: The smallint data type follows the same rules and principles as the int data type except that it is used to store smaller numbers that would range between -32,768 and 32,767.

bigint: The bigint data type follows the same rules and principles as the int data type except that its field can hold numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

binary: The binary data type is used for a column that would hold hexadecimal numbers. Examples of hexadecimal numbers are 0x7238, 0xFA36, or 0xAA48D. Use the binary data type if all entries under the column would have the exact same length (or quantity). If you anticipate that some entries would be different than others, then use the alternativevarbinary data type. The varbinary also is used for hexadecimal numbers but allows dissimilar entries, as long as all entries are hexadecimals.

numeric and decimal: In some columns, users will be asked to enter particular numbers referred to as decimals. A decimal number is a number that can have a period (or the character used as the decimal separator as set in the Control Panel) between the digits. An example would be 12.125 or 44.80. Like an integer, a decimal number can start with a + or just a digit, which would make it a positive number. A decimal number can also start with a - symbol, which would make it a negative number. If the number represents a fraction, a period between the digits specifies what portion of 1 was cut. If you anticipate such a number for a field, specify its data type as numeric or decimal (either decimal or numericwould produce the same effect in SQL Server).

float and real: A floating-point number is a fractional number, like the decimal type. Floating-point numbers can be used if you would allow the database engine to apply an approximation to the actual number that a field is supposed to carry.

money: As its name announces it, the money data type can be used on a column whose data would consist of currency values. A field with a money data type can hold positive or negative values from -922,337,203,685,477.5808 to +922,337,203,685,477.5807

smallmoney: While the money data type can be used for a field that would hold large quantities of currency values, the smallmoney data type can be applied for a column whose value cannot be lower than -214,748.3648 nor higher than 214,748.3647

char: A field of characters can consist of any kinds of alphabetical symbols in any combination, readable or not. If you want a column to hold a fixed number of characters, such as the book shelf numbers of a library, use the char data type for such a column.

varchar: In the computer world, a string is a character or a combination of characters that are considered "as is" with regards to the scenario in which they are used. In a table, some columns are meant to hold such strings. One of the most significant characteristics of such a field is that data entered into it can change from one record to another. An example would be the first names of employees: people have different first names of different lengths. If a column will hold strings of different lengths, apply a varchar data type to it. The maximum length of text that a field of varchar type can hold is equivalent to 8 kilobytes.

text: The text data type can be applied to a field whose data would consist of ASCII characters. As opposed to a varchar type of field, a text type of field can hold text that is longer than 8 kilobytes.

nchar, nvarchar, and ntext: These three types follow the same rules as the char,varchar, and text respectively, except that they can be applied to columns that would hold international characters, that is, characters of languages other than US English. This is done following the rules of Unicode formats.

datetime: As its name suggests, a datetime data type is used for a column whose data would consist of date and/or time values. The entries must be valid date or time values but SQL Server allows a lot of flexibility, even to display a date in a non-traditional format. The date value of a datetime field can be comprised between January 1st, 1753 and December 31, 9999.

smalldatetime: The smalldatetime is an alternative to the datetime data type. It follows the same rules and principles as the datetime data type except that a date value must be comprised between January 1st, 1900 and June 6, 2079.

The Length of Data

A database deals with various types of data, appropriate or not for certain fields. This means that you should take care of jobs behind the scenes as much as you can. One way you can do this is by controlling the amount of information that can be entered in a particular field. As various columns can hold different types of data, so can the same data type control its own mechanism of internal data entry. The length of data means different things to different fields. Columns that carry the same data type can have different lengths.

Bit Fields: We saw already that a bit column type is meant for one of two answers. The user is supposed to simply let the database know that the answer is yes or no, true or false, on or off, 1 or 0. Therefore, the only length of this field is 1.

Integers: The length of an integer is the number of bytes its field can hold. For an int type, that would be 4 bytes.

Decimal and Floating-Point Numbers: The Length specifies how many bytes the field can store.

Strings: The Length of a character or string column specifies the maximum number of characters that the field can hold.

In some circumstances, you will need to change or specify the length as it applies to a particular field. For example, since you should use the varchar data type for a string field whose content will change from one record to another, not all varchar columns need to have the same length. Although a First Name and a Book Title columns should use thevarchar type, both columns would not have the same length of entries. As it happens, people hardly have a first name that is beyond 20 characters and many book titles go beyond 32 characters. In this case, both fields would use the same data type but different lengths. On the other hand, for columns of datetime and money data types, you should accept the default length suggested by the database.

Wednesday, December 9, 2009

The Remote Server returned and error: NotFound.

Today I spent a fair amount of time tracking down a problem that I first thought was a WCF Web Service Issues but turns out to be a
Linq To SQL issue / Visual Studio issue.

Here are the steps I followed to create the issue.

1. So for this project I added a Li3.nq to Sql class, say by the name StoredProcContext.dbml.

2. After that I added a stored procedure to the StoredProcContext.dbml via the designer.

3. Here be the issue. When you add a Stored Proc that returns a result and the size is a single Char(1).

4. Typically if the results return a Char(10) the result class that gets generated makes the result a "string". However, if it is a Char(1) it keeps it as a Char type.
Member Variable:


Property Variable






5. This will cause an error when calling the web service. "The Remote Server returned and error: NotFound.



Solution:
Go into your LinqToSql Class and find your result object class and change the private member variable from char to String. Also don't forget to change the Property return type for the same variable to a string as well.

Monday, November 16, 2009

Sharepoint and Silverlight Setup

This blog main purpose is to keep up with my notes as I solve issues and problems while developing in SharePoint.

Deploying a Silverlight Control to SharePoint 2007

  1. Copy the System.web.Silverlight.dll into the GAC (Global Assembly Cache). Once you install the Silverlight on the server/development environment you will have the dll in the following location: C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server\System.Web.Silverlight.dll

  2. There are a couple of different approaches to deploying your Silverlight project to your web server. I have done several from just creating a ClientBin directory on the server to hosting in an Apache web server to be served in to a Joomla PHP application. My opinion the best place to deploy it is in the 12 hive. Main reason is most likely you are going to create a web part to deploy on your page. Or at a minium you are going to create a new feature to make deployment easy. So for my application I create a folder under the LAYOUTS directory in the 12 hive. For anyone not sure what the 12 hive is it is just the file structure SharePoint uses to store its modules ie Features, Masterpages, Styles, etc... It is located at:
    C:\Program Files (x86)\Common Files\Microsoft Shared\Web Server Extensions\12

    Under the 12 folder there are several folders but the one I am looking for is
    12\TEMPLATE\LAYOUTS

    Now create a folder to hold the silverlight .xap file 12\TEMPLATE\LAYOUTS\MyFeature and copy my .xap file to this location.

    Now of course I don't do this manually I use WSPBuilder and create this structure in the VS2008 application. And when you deploy it will handle putting it in the correct location.
    Now you can build and deploy your feature to SharePoint but it still will not work we have more to do.


  3. Before the web server can serve up the .xap file you will have to add some mime types to the virtual directory you are using to store the .xap file. Since I am storing my .xap file in the 12/TEMPLATES/LAYOUTS/... directory I am going to add the MIME Types to the LAYOUTS Directory.













  4. Now for some Web.Config file changes. Probably a good idea to make a backup copy of the web.config file before making changes...

    Add this under the <configSections> tag:

    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

    <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />

    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />

    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />

    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />

    </sectionGroup>

    </sectionGroup>

    </sectionGroup>


    Add this under the <assemblies> tag:

    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>


    Add this under the <pages> tag:

    <controls>

    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    </controls>


    Add this under the <httpHandlers> tag:

    <remove verb="*" path="*.asmx"/>

    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>


    Add this under the <httpModules> tag:

    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>


    Add this under the <runtime> tag:

    <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>

    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>

    </dependentAssembly>

    <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>

    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>

    </dependentAssembly>


    Add this under the < configuration> tag:

    <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>

    <modules>
    <remove name="ScriptModule" />
    <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>

    <handlers>
    <remove name="WebServiceHandlerFactory-Integrated"/>

    <remove name="ScriptHandlerFactory" />

    <remove name="ScriptHandlerFactoryAppServices" />

    <remove name="ScriptResource" />

    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
    type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
    type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>

    </system.webServer>


  5. Now build your silverlight web part and make sure you are pointed to the correct location and it will work. Next will be a blog on building a Silverlight Web Part.