Visual Studio 2005 RC1

Topics: CAB & Smart Client Software Factory
Sep 16, 2005 at 2:32 AM
originally posted by: kljones16

Are there any breaking changes in RC1 that will prevent us from using it with the Sept. 23 release of CAB?
Sep 16, 2005 at 1:36 PM
originally posted by: jgarrison

I am having trouble compiling the current CAB with RC1.

Warning as Error: A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a system.Runtime.CompilerServices.RuntimeWrappedException C:\Program Files\Microsoft patterns and practices\Composite UI Application Block Tech Preview 1\Src\CS\CompositeUI\Services\StreamStatePersistenceService.cs 83 4 CompositeUI


along with some others that might spawn from the one above.

I commented out the extra catches, changed the IsCollectionKey properties to IsKey and changed the RequiredValue properties to IsRequired in the configuration references.
Sep 16, 2005 at 2:30 PM
originally posted by: PProvost

Yes, unfortunately, there are breaking changes in RC1. Our next community release (in a couple of weeks) will be built on RC1.
Sep 20, 2005 at 3:07 AM
originally posted by: CoenNoppert

Are these big changes? We waited for RC1 with our project start so we could use CAB and RC1 instead of using the UIPAB and 2003 (what we are doing now with another project).

Can we easy adapt the current version of the CAB so it will work with RC1? or will it take weeks in which case we probably need to use 2003 and UIPAB.
Sep 21, 2005 at 4:11 AM
originally posted by: uluru

I found that even after making the fixes such as commenting out the extra catch blocks and remeding the ConfigurationPropertyAttribute, I receive the following exception when I run a sample hands-on lab (which I am using for my tests):

System.IO.FileLoadException was unhandled
Message="Could not load file or assembly 'Microsoft.ApplicationBlocks.CompositeUI, Version=1.0.50630.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
Source="BankShell"
FileName="Microsoft.ApplicationBlocks.CompositeUI, Version=1.0.50630.0, Culture=neutral, PublicKeyToken=null"
FusionLog=""
StackTrace:
at BankShell.Program.Main()
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Sep 21, 2005 at 5:18 AM
originally posted by: CoenNoppert

I get the same error for the quick starts :)

System.IO.FileLoadException was unhandled
Message="Could not load file or assembly 'Microsoft.ApplicationBlocks.CompositeUI, Version=1.0.50630.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
Source="CommandsQuickStart"
FileName="Microsoft.ApplicationBlocks.CompositeUI, Version=1.0.50630.0, Culture=neutral, PublicKeyToken=null"
FusionLog=""
StackTrace:
at CommandsQuickStart.Shell.Main()
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Sep 21, 2005 at 7:45 AM
originally posted by: CesarR

We are using CAB CTP1 with the August CTP of the .NET Framework and apart from renaming a few of the ConfigurationProperty attributes, we only trapped non-exceptions with a RuntimeWrappedException clause (in reality, we just reused the last catch clause and explicitly specified RuntimeWrappedException as the exception to be caught in there and then, made sure the clause was above the catch Exception clause).

Finally, we were forced to GAC the CAB assemblies to be able to execute code. Othewise, you can compile it successfully but when you run it you get the nasty exception you guys are getting:
System.IO.FileLoadException was unhandled
Message="Could not load file or assembly 'Microsoft.ApplicationBlocks.CompositeUI, Version=1.0.50630.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
Sep 21, 2005 at 11:01 AM
originally posted by: jnicholsonfl1

I was able to recompile after corercting the same issues noted above and then signed the assemblies and placed them in the GAC and was able to run OK. However, when I attempted to create a menu via the config file I now receive an error that I didn't previously:

System.Configuration.ConfigurationErrorsException was unhandled
Message="Unrecognized element 'add'. (C:\\Development\\Enterprise Library\\Composite UI Application Block Tech Preview 1\\ModuleLoaderShell\\bin\\Debug\\ModuleLoader.vshost.exe.config line 7)"
Source="System.Configuration"
BareMessage="Unrecognized element 'add'."
Filename="C:\\Development\\Enterprise Library\\Composite UI Application Block Tech Preview 1\\ModuleLoaderShell\\bin\\Debug\\ModuleLoader.vshost.exe.config"

//////////////////////////////////

Anyone know why this is now occuring?

Jim
Sep 21, 2005 at 3:31 PM
originally posted by: MichaelBouck

No need to GAC the assemblies. Just comment-out the following line in Src\CS\CompositeUI\Properties\AssemblyInfo.cs:

assembly: HostProtection(SecurityAction.RequestMinimum, MayLeakOnAbort = true)

This is causing the assembly load exception.
Sep 22, 2005 at 10:40 AM
originally posted by: MichaelBouck

OK, think I got this figured out. Apparently there is an issue with having configuration sections as collections. In other words, this works:

<myCollection>
<collection>
<add />
</collection>
</myCollection>

But this doesn't:

<collection>
<add />
</collection>

To fix this in CAB projects. You need to modify your App.config to look like:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="menuItemsSection" type="BankShell.MenuItemsSection, BankShell" />
</configSections>
<menuItemsSection>
<menuitems>
<add uri="uie://mainmenu/File" label="&File" />
<add uri="uie://mainmenu/File/Exit" label="E&xit" commandname="FileExit" key="Alt, F4" />
<add uri="uie://mainmenu/Queue" label="&Queue" />
<add uri="uie://mainmenu/Queue/AcceptCustomer" label="&Accept Customer" commandname="QueueAcceptCustomer" key="Control, A" />
<add uri="uie://mainmenu/Help" label="&Help" />
<add uri="uie://mainmenu/Help/About" label="&About..." commandname="HelpAbout" key="F1" />
</menuitems>
</menuItemsSection>
</configuration>

Then you need to modify your ConfigurationSection-derived class to look like:

class MenuItemsSection : ConfigurationSection
{
// Note: the "IsDefaultCollection = false"
// instructs the .NET Framework to build a nested
// section like <menuitems> ...</menuitems>
ConfigurationProperty("menuitems", IsDefaultCollection = false)
public MenuItemElementCollection MenuItems
{
get { return (MenuItemElementCollection) base"menuitems"; }
}
}

Finally, you need to fixup the code that loads the section:

MenuItemsSection section = (MenuItemsSection)ConfigurationManager.GetSection("menuItemsSection");
Sep 27, 2005 at 8:22 AM
originally posted by: MichaelBouck

I'm getting the "Unrecognized element 'add'." exception as well. Any insight on fixing this issue?

UPDATE: Resolved (see next post). CAB CTP1 w/ VS2005 RC is working fine (so far!)