You are here: Blog Zone
 Register    Login 
Blogging .Net Minimize  

By Tim Wheeler on 12/10/2008

I got this error while trying to call the "CreateDatabase()" method on the DataFactory:

Initialization method MyClass threw exception. Microsoft.Practices.ObjectBuilder2.BuildFailedException:  Microsoft.Practices.ObjectBuilder2.BuildFailedException: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, null]) failed: The value can not be null or an empty string. (Strategy type ConfiguredObjectStrategy, index 2) --->  System.ArgumentException: The value can not be null or an empty string..

Found the answer here: http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=31848

It seems that the new library requires an extra setting in your config if you don't specify the connection name.

Add the dataconfiguration element above your connection strings:

 

<dataConfiguration defaultDatabase="default" />connectionStrings><add name="default" connectionString="Database=ABC;Server=Server;Integrated Security=SSPI" providerName="System.Data.SqlClient"

/>connectionStrings>

By Tim Wheeler on 11/25/2008

Typemock are offering their new product for unit testing SharePoint called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to unit test SharePoint without a SharePoint server. To learn more click here.

The first 50 bloggers who blog this text in their blog and tell us about it, will get a Full Isolator license, Free. for rules and info click here.

By Tim Wheeler on 11/25/2008

Setting up single signon was far more difficult than you are lead to believe by the very simple management page in central admin. 

Doing a typical male thing (as my wife would comment), I jumped straight in and said "hey I don't need no stinking instructions and definately no help guides!".  So, as usual, I was wrong.  (My wife would say that too).

So after some googling I found a great post about setting up single signon here: http://www.wssdemo.com/...

However I did have a couple of other problems on the  Manage Server Settings for Single Sign-On page:

  1. You do not have the rights to perform this operation.
  2. Failed to connect to the database server. Verify connectivity and rights for the configuration account and try again.

 Solutions:

You do not have the rights to perform this operation.

It is saying that you as an administrator does not have permission to do this.  To get past this error you have to launch IE with the RunAs command and run it under the domain account you have setup for the single sign on service. 

Failed to connect to the database server. Verify connectivity and rights for the configuration account and try again

This error occurred because during my clicking frenzy when things weren't working I manually created a database called SSO in between the curses and muttering. Then I got a warning "the database already exists".  So great I go and delete the database from SQL Server, forgetting a simple little fact that the .mdf and .ldf files are not deleted also.  It turns out the error is sharepoint trying to create the SSO database when the files are still on the disk.  So, easiest way, just change the database name or if you want to exercise your clicking finger a few more times, browse to where sql server keeps the mdf and ldf file and delete them.

There is an msdn post on it here: http://support.microsoft.com/kb/944104

By Tim Wheeler on 11/24/2008

if "$(ConfigurationName)" == "Debug" "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\"gacutil /i "$(TargetPath)" /f

By Tim Wheeler on 8/25/2008

Its a real pain when you run out of room in your virtual dev environment.  VMWare has a command line utility that allows you to expand the partition on a .vmdk.  Read more for details.

Read More »

By Tim Wheeler on 7/26/2008

Generally I am developing in a virtual enviornment, normally VMWare.  I had difficulty working away from the office through the company VPN. I also had  difficulties authenticating as we had a seperate development domain.   This post explains the steps to setup the VPN configuration and process for logging in. 

Read More »

By Tim Wheeler on 7/17/2008

I was trying to Unit Test my WCF Service, and for some crazy reason Visual Studio 2008 would issue a stop command to the IIS Admin service and the World Wide Web Publishing service, right before the unit test called the wcf service.  As VS had cleverly stopped the services hosting my WCF service, the call subsequently failed with:

 Test method [method] threw exception:  System.ServiceModel.EndpointNotFoundException: Could not connect to http://localhost/WcfService/v1/MyService.svc. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:80.  --->  System.Net.WebException: Unable to connect to the remote server --->  System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:80.

Found nothing to help me understand why VS behaved this way.  I found that if the WCF project was unloaded the unit test would succeed.  Interestingly enough a college was having another issue with WCF not using the proxy settings defined in the config.  And found a good link about why here: http://blogs.infosupport.com/porint/archive/2007/08/14/Configuring-a-proxy_2D00_server-for-WCF.aspx

Originally I thought this may have been a similar cause, then my college found that turning off code coverage solved the problem.  Open your localtestrun.testrunconfig and remove the code coverage checks. But now I'm not so sure as I still have the issue.  

By Tim Wheeler on 7/16/2008

Had an issue today with a Windows Form.  Visual Studio showed it as a .cs file.  Double clicking on it showed the code rather than the form designer.  I think this is caused by our form inheriting from a DevExpress form.  The fix is to right click on it, exclude it from your project, click "Show All Files" and include it again.    

By Tim Wheeler on 7/9/2008

I was trying to pass an XmlNode as a parameter in my WCF Service.  Didn't think this would be an issue but I kept getting the error:

Type 'System.Xml.XmlNode' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.

I found a like on what types you can use with the DataContractSerializer here: http://msdn.microsoft.com/en-us/library/ms731923(VS.85).aspx

So it support only an Array of XmlNode, WHAT?! Ok, fine so then we use XmlElement instead, or pass in an array with 1 item. 

By Tim Wheeler on 7/7/2008

Recently I encountered a slight issue with the Import Scripts function on the Visual Studio 2008 database project.

Situation:
I was receiving the following error when executing one of my stored procedures in SQL Server 2005.

INSERT failed because the following SET options have incorrect settings: 'ANSI_NULLS, QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods.

Reason:
The stored procedeure has TSQL syntax that required:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

Cause:
This was only occuring after I did a Deploy from the database project in visual studio.  When I built the SP, and when I re ran my original SP script manually everything worked fine.  It seemed that the database project was altering these settings.  What I found is that the ScriptsIgnoredOnImport.sql contained the two SET options that my SP required, and when the database project deployed, it obviously didn't use those SET options. 

Fix:
This probably sounds really obvious but here it is:
In the database project select your stored procedure in the solution explorer, bring up the properties windw (F4), and set the ANSI nulls property to On and the Quoted Identifiers property to On.  (Stop laughing now ok)

A bug?  Well I'm sure MS would say this is a Feature, but it seems that the Import Script function ignores the SET options for the stored procedure imports.

 

Search Minimize  

Code Artist.net v1.1 Minimize 

Code Artist.net released!  

With a simple to use interface your .net web sites will be showing professional looking source code in minutes.

Your Code, Your Format - Code Artist presents code like it’s meant to be seen.

More...


DotNetNuke Hosting Minimize  

Need professional DotNetNuke hosting from as little as $10 per month?  Contact Us for all your DotNetNuke needs with a package to suit everyone.  Our services include:

  • Free Base Setup
  • Free Premium Modules and Skins
  • Offsite Backup
  • High Availability > 99.5%
  • SSL Certificates
  • Business Portals from $500
  • Professional Help and Support

Enquire here about DotNetNuke Hosting.


 Copyright 2008 PureCoding.net
 Terms Of Use     Privacy Statement