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

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.0 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