I had a problem recently with some files from the .NET Framework 2.0 being corrupt. I think the root cause of the problem was use of Virtual Machines. Anyway, I needed to repair the .NET Framework 2.0, specifically aspnet_regiis.exe.
The problem is that under Windows Vista and Windows Server 2008 these components are part of the operating system so you can't do a repair with the MSI like you normally can with installed programs. After doing some digging I found the answer here:
http://blogs.msdn.com/astebner/archive/2007/03/26/how-to-repair-the-net-framework-2-0-and-3-0-on-windows-vista.aspx
The short story is to run "sfc /scannow" with elevated privileges.
Thursday, 16 October 2008
Sunday, 5 October 2008
Visual Studio Team System Developer & Database Editions are merged
Microsoft has recently announced that the Visual Studio Team System Developer & Database Editions are to be merged, details are here: http://msdn.microsoft.com/en-us/vsts2008/products/cc990295.aspx
Essentially MSDN Subscribers with a "Visual Studio Team System Developer" or "Visual Studio Team System Database" (or relevant Partner Programs) will be given access to the alternative SKU. Please note that these products are not a single installation, you need to install both products. This results in you having both SKUs installed which means you will get additional features/menus in Visual Studio. This affects the current toolset in addition to Rosario (VS2010).
This is a great move by Microsoft, the features of the Database Edition are incredibly useful to a developer. There is a new Database Project type that supports MSBuild, this means you can build/rebuild you database schema from the IDE or from the command line. The schema compare facilities give you functionality broadly equivalent to RedGate's fantastic SQL Compare product (http://www.red-gate.com/products/SQL_Compare/index.htm).
Essentially MSDN Subscribers with a "Visual Studio Team System Developer" or "Visual Studio Team System Database" (or relevant Partner Programs) will be given access to the alternative SKU. Please note that these products are not a single installation, you need to install both products. This results in you having both SKUs installed which means you will get additional features/menus in Visual Studio. This affects the current toolset in addition to Rosario (VS2010).
This is a great move by Microsoft, the features of the Database Edition are incredibly useful to a developer. There is a new Database Project type that supports MSBuild, this means you can build/rebuild you database schema from the IDE or from the command line. The schema compare facilities give you functionality broadly equivalent to RedGate's fantastic SQL Compare product (http://www.red-gate.com/products/SQL_Compare/index.htm).
Monday, 30 June 2008
XBAP applications and Strong Naming.
One of the first things that is hammered into you when start reading up on XBAP applications is that they run with Partial Trust. There are ways to get your XBAP application running with full trust but this is not the typical scenario (and that topic is worth a whole series of blog posts).
When you Strong Name an assembly, by default the assembly will not allow Partially Trusted callers. As the sandbox in which your XBAP applications run is running with Partial Trust, this means that you will get the following error in the browser when you try to run your application
Startup URI: C:\dir\MyApplication.xbapApplication Identity: file:///C:/dir/MyApplication.xbap#MyApplication.xbap, Version=x.x.x.x, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil/MyApplication.exe, Version=x.x.x.x, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil, type=win32
System.Security.SecurityException: That assembly does not allow partially trusted callers. at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel) at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData) at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext) at System.Windows.Interop.PresentationApplicationActivator.CreateInstance(ActivationContext actCtx) at System.Activator.CreateInstance(ActivationContext activationContext) at System.AppDomain.InternalRemotelySetupRemoteDomainHelper(Object[] args) at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args) at System.AppDomain.nCreateInstance(String friendlyName, AppDomainSetup setup, Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, IntPtr parentSecurityDescriptor) at System.Runtime.Hosting.ApplicationActivator.CreateInstanceHelper(AppDomainSetup adSetup) at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData) at System.Windows.Interop.PresentationApplicationActivator.CreateInstance(ActivationContext actCtx) at System.Windows.Interop.ApplicationLauncherXappDebug.Initialize() at System.Windows.Interop.DocObjHost.MS.Internal.AppModel.IBrowserHostServices.Run(String path, String debugSecurityZoneURL, String viewerUri, String fragment, String applicationId, MimeType mime, Object streamContainer, Object ucomLoadIStream, String userAgentString, Boolean isDebugMode, String progressAssemblyName, String progressClassName, String errorAssemblyName, String errorClassName)The action that failed was:LinkDemandThe method that caused the failure was:Void Main()
To prevent this problem, you need to mark your XBAP assembly with the AllowPartiallyTrustedCallersAttribute, for example:
With this Attribute your XBAP application will now run.
When you Strong Name an assembly, by default the assembly will not allow Partially Trusted callers. As the sandbox in which your XBAP applications run is running with Partial Trust, this means that you will get the following error in the browser when you try to run your application
Startup URI: C:\dir\MyApplication.xbapApplication Identity: file:///C:/dir/MyApplication.xbap#MyApplication.xbap, Version=x.x.x.x, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil/MyApplication.exe, Version=x.x.x.x, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil, type=win32
System.Security.SecurityException: That assembly does not allow partially trusted callers. at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel) at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData) at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext) at System.Windows.Interop.PresentationApplicationActivator.CreateInstance(ActivationContext actCtx) at System.Activator.CreateInstance(ActivationContext activationContext) at System.AppDomain.InternalRemotelySetupRemoteDomainHelper(Object[] args) at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args) at System.AppDomain.nCreateInstance(String friendlyName, AppDomainSetup setup, Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, IntPtr parentSecurityDescriptor) at System.Runtime.Hosting.ApplicationActivator.CreateInstanceHelper(AppDomainSetup adSetup) at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData) at System.Windows.Interop.PresentationApplicationActivator.CreateInstance(ActivationContext actCtx) at System.Windows.Interop.ApplicationLauncherXappDebug.Initialize() at System.Windows.Interop.DocObjHost.MS.Internal.AppModel.IBrowserHostServices.Run(String path, String debugSecurityZoneURL, String viewerUri, String fragment, String applicationId, MimeType mime, Object streamContainer, Object ucomLoadIStream, String userAgentString, Boolean isDebugMode, String progressAssemblyName, String progressClassName, String errorAssemblyName, String errorClassName)The action that failed was:LinkDemandThe method that caused the failure was:Void Main()
To prevent this problem, you need to mark your XBAP assembly with the AllowPartiallyTrustedCallersAttribute, for example:
[assembly: AllowPartiallyTrustedCallers]
With this Attribute your XBAP application will now run.
Wednesday, 25 June 2008
Microsoft Dynamics CRM 4.0 install error "The instance name must be the same as computer name."
If you are installing Microsoft Dynamics CRM 4.0 to a computer that you have renamed, this can cause problems depending on when you installed SQL Server 2005. If you installed SQL Server before you renamed the box, you will receive the following error regarding SQL Server 2005 when the installer does a system check:
"The instance name must be the same as computer name."
To fix this problem you need to update the name of the machine in SQL Server by executing the following:
sp_dropserver 'OldMachineName'
GO
sp_addserver 'NewMachineName', local
GO
You will also need to restart the SQL Server service. Please note you can't use this command to change the instance suffixes. For example you can NOT change "serverA\SomeInstance" to "serverA\AnotherInstance", you may only change "serverA\SomeInstance" to "serverB\SomeInstance".
For more information see the following MSDN article: http://msdn.microsoft.com/en-us/library/ms143799.aspx
You may also need to update Reporting Services: http://msdn.microsoft.com/en-us/library/ms345235.aspx
This situation can easily arise if you have a virtual envrionment and are cloning machines.
"The instance name must be the same as computer name."
To fix this problem you need to update the name of the machine in SQL Server by executing the following:
sp_dropserver 'OldMachineName'
GO
sp_addserver 'NewMachineName', local
GO
You will also need to restart the SQL Server service. Please note you can't use this command to change the instance suffixes. For example you can NOT change "serverA\SomeInstance" to "serverA\AnotherInstance", you may only change "serverA\SomeInstance" to "serverB\SomeInstance".
For more information see the following MSDN article: http://msdn.microsoft.com/en-us/library/ms143799.aspx
You may also need to update Reporting Services: http://msdn.microsoft.com/en-us/library/ms345235.aspx
This situation can easily arise if you have a virtual envrionment and are cloning machines.
Monday, 7 April 2008
Windows 2008 Server Core does not support managed code
Yes, you read the title correctly.
The Windows 2008 Server Core SKU does not support any managed code, that means no .NET applications at all. Period.
More info in the "Server Core Installation Option of Windows Server 2008 Step-By-Step Guide" here: http://technet2.microsoft.com/windowsserver2008/en/library/47a23a74-e13c-46de-8d30-ad0afb1eaffc1033.mspx?mfr=true
The Windows 2008 Server Core SKU does not support any managed code, that means no .NET applications at all. Period.
More info in the "Server Core Installation Option of Windows Server 2008 Step-By-Step Guide" here: http://technet2.microsoft.com/windowsserver2008/en/library/47a23a74-e13c-46de-8d30-ad0afb1eaffc1033.mspx?mfr=true
Apple Safari for Windows
Apple has recently release its Safari browser for Windows: http://www.apple.com/safari/
While I hate the fonts (no where near as good as Internet Explorers Clear Type goodness) the browser itself is blisteringly fast. I use Newsgator On-line as my RSS aggregator and under IE it runs fairly slow (there is alot of JavaScript). Under Safari it is incredibly fast.
The browser wars are here again.
While I hate the fonts (no where near as good as Internet Explorers Clear Type goodness) the browser itself is blisteringly fast. I use Newsgator On-line as my RSS aggregator and under IE it runs fairly slow (there is alot of JavaScript). Under Safari it is incredibly fast.
The browser wars are here again.
Sunday, 6 April 2008
MSBuild, VS2008 and "Invalid search path"
Since installing VS2008 I have been getting the following error when using the VS2008 Command Prompt and trying to build Visual Studio solutions or trying to run "local" Team Builds:
CSC : error CS1668: Warning as Error: Invalid search path 'C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
The reason for this is that the environment variables configured for this command console assume you have installed the C++ components with Visual Studio (which I did not install for the sakes of disk space).
The easiest way to solve this problem is to create the path. The "'C:\Program Files\\Microsoft SDKs\Windows\v6.0A\" path should already exist, so just create a "Lib" folder at that location.
Its a simple fix but working out why this was a problem was tricky, it niggled me why a fairly straight forward install of VS2008 would have a not insignificant problem.
CSC : error CS1668: Warning as Error: Invalid search path 'C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
The reason for this is that the environment variables configured for this command console assume you have installed the C++ components with Visual Studio (which I did not install for the sakes of disk space).
The easiest way to solve this problem is to create the path. The "'C:\Program Files\\Microsoft SDKs\Windows\v6.0A\" path should already exist, so just create a "Lib" folder at that location.
Its a simple fix but working out why this was a problem was tricky, it niggled me why a fairly straight forward install of VS2008 would have a not insignificant problem.
Thursday, 13 March 2008
Generating a Schema for the BizTalk SQL Adapter
To call a Stored Procedure from BizTalk you need to use the SQL Adapter. This requires you add a special Schema to your BizTalk application, this Schema is generated by a wizard in Visual Studio (the wizard is installed as part of the BizTalk SDK).
This process isn't as straight forward as it should be an its easy to end up with a Schema where the value returned from the Stored Procedure is represented by a "Success" Element of "anyType which is useless.
Firstly, you must have a Stored Procedure that that returns a result set using "FOR XML AUTO". Secondly, when you run through the wizard you must add "XMLDATA" to the end of the Stored Procedure (and remove it after you have generated the Schema). The XMLDATA clause causes SQL Server to return the Schema for the result set (as well as the result). So, when you go through the wizard you must have a stored procedure looking something like this:
SELECT ColumnA, ColumnB FROM MyTable FOR XML AUTO, XMLDATA
After you have generated your schema, remove the "XMLDATA" clause to leave:
SELECT ColumnA, ColumnB FROM MyTable FOR XML AUTO
When you run through the wizard, most of the values you need to enter are obvious but when you get to the "Schema Information" screen, you need to change the "Port Type" to "Send".
When you get to the "Statement Information" screen, you need to enter valid values into the "Value" column (click the Value cell twice to enter data). Then hit "Generate", then hit "Next".
The SQL Adapter Wizard does not seem to support "FOR XML EXPLICIT", you get an error that says "the required attribute 'name' is missing". However, I would guess that if you can generate the boiler plate Schema using "FOR XML AUTO," you should be able to change your Stored Procedure and then manually edit the Schema generated by the Wizard to match what your XML EXPLICIT format.
This process isn't as straight forward as it should be an its easy to end up with a Schema where the value returned from the Stored Procedure is represented by a "Success" Element of "anyType which is useless.
Firstly, you must have a Stored Procedure that that returns a result set using "FOR XML AUTO". Secondly, when you run through the wizard you must add "XMLDATA" to the end of the Stored Procedure (and remove it after you have generated the Schema). The XMLDATA clause causes SQL Server to return the Schema for the result set (as well as the result). So, when you go through the wizard you must have a stored procedure looking something like this:
SELECT ColumnA, ColumnB FROM MyTable FOR XML AUTO, XMLDATA
After you have generated your schema, remove the "XMLDATA" clause to leave:
SELECT ColumnA, ColumnB FROM MyTable FOR XML AUTO
When you run through the wizard, most of the values you need to enter are obvious but when you get to the "Schema Information" screen, you need to change the "Port Type" to "Send".
When you get to the "Statement Information" screen, you need to enter valid values into the "Value" column (click the Value cell twice to enter data). Then hit "Generate", then hit "Next".
The SQL Adapter Wizard does not seem to support "FOR XML EXPLICIT", you get an error that says "the required attribute 'name' is missing". However, I would guess that if you can generate the boiler plate Schema using "FOR XML AUTO," you should be able to change your Stored Procedure and then manually edit the Schema generated by the Wizard to match what your XML EXPLICIT format.
Wednesday, 5 March 2008
Microsoft SharedView Version 1.0 available
Microsoft’s desktop sharing application, called SharedView, is out of beta. Think of the application as “Live Meeting”-lite, where up to 15 people can all share one desktop.
Download from here: http://www.connect.microsoft.com/content/content.aspx?ContentID=5306&SiteID=94
Download from here: http://www.connect.microsoft.com/content/content.aspx?ContentID=5306&SiteID=94
Monday, 3 March 2008
Gated Check-ins and Team Foundation Server
There was a discussion lately on the ALT.NET mailing list about the merits of NAnt versus MSBuild. This discussion expanded to encompass the various build engines there are outt here such as CruiseControl.NET (open source from ThoughtWorks) and TeamCity (free for non-Enterprise use, by JetBrains).
Someone mentioned the "private build" feature of TeamCity where by you ask the build server to do a build of what you currently have but without actually checking in your code to the source tree.
I pointed out that this feautre is also supported by Team Foundation Server through an open source framework exisits called Gauntlet (http://www.opengauntlet.org/). The elevator pitch from the Gauntlet web site is as follows:
"OpenGauntlet...mimics a fundamental feature of Microsoft's internal development system (codenamed Gauntlet), also known as "Gated Checkins". It avoids the problems associated with large development teams whereby a single developer will check in non-compiling code, which subsequently causes delays in the development life cycle as the team waits for the issues to be resolved. It can also be configured to disallow check ins if the proposed code changes break the unit tests. The central principle is that users are not allowed to check code directly into source control. Instead, they shelve their changes with a specific naming prefix when they are ready to check some changes in, and OpenGauntlet unshelves their changes into a temporary workspace, checks the changes compile and pass unit tests, and then checks the changes into source control under the requesting developer's username."
I've not taken the plunge with setting this up yet, I have an upgrade to TFS2008 to do first, but it looks like a must have. Here's to less "red" builds!
Someone mentioned the "private build" feature of TeamCity where by you ask the build server to do a build of what you currently have but without actually checking in your code to the source tree.
I pointed out that this feautre is also supported by Team Foundation Server through an open source framework exisits called Gauntlet (http://www.opengauntlet.org/). The elevator pitch from the Gauntlet web site is as follows:
"OpenGauntlet...mimics a fundamental feature of Microsoft's internal development system (codenamed Gauntlet), also known as "Gated Checkins". It avoids the problems associated with large development teams whereby a single developer will check in non-compiling code, which subsequently causes delays in the development life cycle as the team waits for the issues to be resolved. It can also be configured to disallow check ins if the proposed code changes break the unit tests. The central principle is that users are not allowed to check code directly into source control. Instead, they shelve their changes with a specific naming prefix when they are ready to check some changes in, and OpenGauntlet unshelves their changes into a temporary workspace, checks the changes compile and pass unit tests, and then checks the changes into source control under the requesting developer's username."
I've not taken the plunge with setting this up yet, I have an upgrade to TFS2008 to do first, but it looks like a must have. Here's to less "red" builds!
Subscribe to:
Posts (Atom)