
5.28.2003
ASP.NET 1.1 Request Validation
ASP.NET 1.1 has Request Validation. I guess what this means is that they look for suspicious data coming into a page from a form POST. If it's "potentially dangerous", they throw a HttpRequestValidationException.
To turn this off, you add this to web.config:
You can also do this on a page-by-page basis (probably the preferred mechanism for a large site) by adding to the @Page directive:
<<@ Page ValidateRequest="false" ... %>
To turn this off, you add this to web.config:
<system.web><pages> Element
<pages requestValidation="false" />
</system.web>
You can also do this on a page-by-page basis (probably the preferred mechanism for a large site) by adding to the @Page directive:
<<@ Page ValidateRequest="false" ... %>
5.20.2003
Object Model that Flushes on Demand
Bamboo.Prevalence - a .NET object prevalence engine
Kral told me about this -- store in-memory object model and then keep the deltas in memory until it "flushes" somehow?!
Kral told me about this -- store in-memory object model and then keep the deltas in memory until it "flushes" somehow?!
5.19.2003
ASP 1.1 - It Works! (transition from 1.0 blues)
Whew - at long last, my script mappings are back to ok, and things seem a-ok. What I found:
My script mappings, as shown best using ...\inetpub\adminscripts\adsutil.vbs enum w3svc were all hosed up. There were many more entries in there than should have been, all repeated 3 or 4 times. Looks like the mappings for .aspx, etc. were pointing to 1.0 framework at the top of the list, then about 3 repeated sections of mappings for 1.1 framework after that. I'm guessing that the IIS engine reads the "list" at runtime and stops at the first match -- so would always get the 1.0 settings.
The Symptom: When opening or creating a web project using the 7.1 IDE, I would get a message saying my web server is still at .NET 1.0, should we set the project for 1.0 compliance? This is something to do with it sucking in the 1.0 DLLs from the script mappings.
The IIS GUI was hosed up as well - probably due to the same repeating nature of the list. Even when I change the mapping for a particular file extension in the GUI, it wouldn't "stick". Probably would add to the end of the list. (Probably similar to what the aspnet_regiis.exe tool was doing [see below] )
Finally - decided to use the raw adsutil.vbs script to view the raw data in the IIS metabase. Useful tool - can get/set all properties, some of which aren't available in the IIS GUI. Problem is, for the LIST datatype, which ScriptMaps is, you can only pass up to 10 items. The script map as is with .NET 1.0 is 30 items.
So....wrote my own specialized version of the adsutil.vbs that only does ScriptMaps property for a given IIS node. Reads the entries from a file, stores them in an array, then hands that array to IIS via the IIsObject.put "ScriptMaps", listObject syntax.
Don't forget to IIsObject.SetInfo afterwards to save the info. (if you don't then all subsequent access to that property is locked and you'll get some error like "can't write to that path at this time" -- have to restart iis to lose the dangling lock)
-------
After all this pain getting IIS script mappings repaired to point to the 1.1 Framework, here is some reference info for future use.
Using the Metabase Reference Pages
Also - found from searching groups, that BE CAREFUL editing the script maps. If you leave out a given extension, IIS will assume that is a plain text file and offer it back to the client untouched.
ex: remove .asp extension from the script mappings, then hit an asp page on your server. the file, with all server code in plain sight, will be returned to the caller!!
My script mappings, as shown best using ...\inetpub\adminscripts\adsutil.vbs enum w3svc were all hosed up. There were many more entries in there than should have been, all repeated 3 or 4 times. Looks like the mappings for .aspx, etc. were pointing to 1.0 framework at the top of the list, then about 3 repeated sections of mappings for 1.1 framework after that. I'm guessing that the IIS engine reads the "list" at runtime and stops at the first match -- so would always get the 1.0 settings.
The Symptom: When opening or creating a web project using the 7.1 IDE, I would get a message saying my web server is still at .NET 1.0, should we set the project for 1.0 compliance? This is something to do with it sucking in the 1.0 DLLs from the script mappings.
The IIS GUI was hosed up as well - probably due to the same repeating nature of the list. Even when I change the mapping for a particular file extension in the GUI, it wouldn't "stick". Probably would add to the end of the list. (Probably similar to what the aspnet_regiis.exe tool was doing [see below] )
Finally - decided to use the raw adsutil.vbs script to view the raw data in the IIS metabase. Useful tool - can get/set all properties, some of which aren't available in the IIS GUI. Problem is, for the LIST datatype, which ScriptMaps is, you can only pass up to 10 items. The script map as is with .NET 1.0 is 30 items.
So....wrote my own specialized version of the adsutil.vbs that only does ScriptMaps property for a given IIS node. Reads the entries from a file, stores them in an array, then hands that array to IIS via the IIsObject.put "ScriptMaps", listObject syntax.
Don't forget to IIsObject.SetInfo afterwards to save the info. (if you don't then all subsequent access to that property is locked and you'll get some error like "can't write to that path at this time" -- have to restart iis to lose the dangling lock)
-------
After all this pain getting IIS script mappings repaired to point to the 1.1 Framework, here is some reference info for future use.
Using the Metabase Reference Pages
Also - found from searching groups, that BE CAREFUL editing the script maps. If you leave out a given extension, IIS will assume that is a plain text file and offer it back to the client untouched.
ex: remove .asp extension from the script mappings, then hit an asp page on your server. the file, with all server code in plain sight, will be returned to the caller!!
5.16.2003
ASP.NET -- Framework 1.1 Version Issues
ASP.NET - upgrading to framework 1.1
Compatibility Considerations and Version Changes from gotdotnet
aspnet_regiis.exe -i (find this in the .net framework directory)
When opening a project built with VS.NET 7.0 and Fwork 1.0, now that I've installed VS.NET 7.1 and fwork 1.1, got message that the asp.net config on this machine is still at 1.0. Should the project be set to be compatible with 1.0?
----
Still not sure what I did to fix it. Couldn't find much help on Google, etc. other than uninstall, reinstall asp.net mappings using aspnet_regiis.exe.
Even after -i (install) of the 1.1 framework, the IIS Mgr mappings GUI still shows 1.0 framework linkage -- for .aspx file, it load aspnet_isapi.dll
Finally went with these steps, and now it works (successfully upgraded the web project into 7.1 and fx 1.1), but not sure if I'm in a good state:
Only bummer now is, when look at mappings in IIS GUI, I see only the one setting for .aspx is set to 1.1 framework --- all others for other extensions are all mapped to framework 1.0 files. Not sure how good this is, when working in the future with SOAP, xml, web services, etc.
----
MSDN docs about ASP.NET versions on the machine, how to configure which apps run which versions, etc.
Although, can't quite get this working on my work machine. Even though all apps are apparently mapped to 1.1, they still run 1.0 (seen by viewing aspnet_wp.exe path in module list)
Side-by-Side Support in ASP.NET
Go to IIS Manager, Web Service Extensions, select Active Server Pages, click "Allow".
Compatibility Considerations and Version Changes from gotdotnet
aspnet_regiis.exe -i (find this in the .net framework directory)
When opening a project built with VS.NET 7.0 and Fwork 1.0, now that I've installed VS.NET 7.1 and fwork 1.1, got message that the asp.net config on this machine is still at 1.0. Should the project be set to be compatible with 1.0?
----
Still not sure what I did to fix it. Couldn't find much help on Google, etc. other than uninstall, reinstall asp.net mappings using aspnet_regiis.exe.
Even after -i (install) of the 1.1 framework, the IIS Mgr mappings GUI still shows 1.0 framework linkage -- for .aspx file, it load aspnet_isapi.dll
Finally went with these steps, and now it works (successfully upgraded the web project into 7.1 and fx 1.1), but not sure if I'm in a good state:
- Manually changed mapping in IIS GUI for .aspx to the 1.1 framework path to aspnet_isapi.dll
- Browse to page, get one liner error code - 0x80040005 -- not good.
- Manually changed it back to use 1.0 path to aspnet_isapi.dll for .aspx files.
- Browse to page, get same error - uh, oh...
- cmd prompt, run aspnet_regiis.exe -i in the 1.0 dir. This reinstates ASP.NET 1.0 to be the default setup. -lv after this confirms that 1.0 is mapped to all virtual roots
- cmd prompt, run aspnet_regiis.exe -i in the 1.1 dir. Now this "upgrades" things to 1.1
- Browse to page, get success!
- Open web project in vs7.1 IDE --- WOOT!! -- I no longer get the "server is 1.0" prompt, just get the "this project needs upgrading" message!
Only bummer now is, when look at mappings in IIS GUI, I see only the one setting for .aspx is set to 1.1 framework --- all others for other extensions are all mapped to framework 1.0 files. Not sure how good this is, when working in the future with SOAP, xml, web services, etc.
----
MSDN docs about ASP.NET versions on the machine, how to configure which apps run which versions, etc.
Although, can't quite get this working on my work machine. Even though all apps are apparently mapped to 1.1, they still run 1.0 (seen by viewing aspnet_wp.exe path in module list)
Side-by-Side Support in ASP.NET
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis.exe -lk
W3SVC/ 1.1.4322.0
W3SVC/1/ROOT/ 1.1.4322.0
W3SVC/1/ROOT/Printers/ 1.1.4322.0
W3SVC/1/ROOT/webctrl_samples/ 1.1.4322.0
Windows Server 2003
"Secure by Default" - they aren't kidding. You have to enable the "Application Server" role to setup IIS. But now it still does not serve up ASP pages.Go to IIS Manager, Web Service Extensions, select Active Server Pages, click "Allow".
5.14.2003
System.Management (WMI) in .NET
Using WMI in .NET to get system information.
From my quick reading of using WMI from .NET, it looks like everything you use SQL sort of syntax on a set of "objects". The objects (Win32 classes) are here. For example, look at Operating System, File System, Win32_LogicalDisk.
select FreeSpace, Size, Name from Win32_LogicalDisk where DriveType=3"
Also Operating System, Operating System Settings, Win32_OperatingSystem
Unfortunately, these WMI related queries only work on Windows ME and higher by default, unless you install the WMI package separately on Win9x machines.
From my quick reading of using WMI from .NET, it looks like everything you use SQL sort of syntax on a set of "objects". The objects (Win32 classes) are here. For example, look at Operating System, File System, Win32_LogicalDisk.
select FreeSpace, Size, Name from Win32_LogicalDisk where DriveType=3"
Also Operating System, Operating System Settings, Win32_OperatingSystem
Unfortunately, these WMI related queries only work on Windows ME and higher by default, unless you install the WMI package separately on Win9x machines.
IE Web Controls
Apparently, not currently supported by MS, and most only work with 1.0 framework for now.
Docs on the TreeView WebControl
Overall Web Controls Reference (Multipage, tabstrip, toolbar, treeview)
Web Controls Download
Docs on the TreeView WebControl
Overall Web Controls Reference (Multipage, tabstrip, toolbar, treeview)
Web Controls Download
5.13.2003
Asynchronous Web Service Call
Proxy created by IDE for a given web service (e.g. ListCustomers) -- contains both sync and async methods.
BeginListCustomers( callbackWhenDone )
system uses thread from ThreadPool, then calls callback delegate.
However, you can't do any UI updating in this callback, since it's running on another thread.
public virtual IAsyncResult BeginInvoke(Delegate, object[]);
Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on.
Now UI handler will be called on the main UI thread. From here, can do all your updating.
MSDN TV show about this here
BeginListCustomers( callbackWhenDone )
system uses thread from ThreadPool, then calls callback delegate.
However, you can't do any UI updating in this callback, since it's running on another thread.
public virtual IAsyncResult BeginInvoke(Delegate, object[]);
Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on.
Now UI handler will be called on the main UI thread. From here, can do all your updating.
MSDN TV show about this here
Silent Installs of Framework
Framework: dotnetfx.exe /q:a /c:"install /l /q"
MDAC: MDAC_TYP.EXE /q:a /c:"dasetup.exe /q /n"
install the .NET Framework silently
silent install
MDAC: MDAC_TYP.EXE /q:a /c:"dasetup.exe /q /n"
install the .NET Framework silently
silent install
5.12.2003
VS 7.1 (2003) Auto Link Dependencies c++
This bugged us for a while, then we found a setting to turn it off. The issue is this:
When you set a dependency in the solution, say A is dependent on B...the IDE will then LINK B when linking A. This is not always the desired behavior, like when trying to use dependencies to merely control the build order. COM objects, other EXEs, resource only DLLs, etc. do not have a .lib and therefore cause linker to barf when looking for this "dependent" lib.
Fix:
For the dependent project (B in above sample case), project settings, linker, general, set Ignore Import Library to Yes.
When you set a dependency in the solution, say A is dependent on B...the IDE will then LINK B when linking A. This is not always the desired behavior, like when trying to use dependencies to merely control the build order. COM objects, other EXEs, resource only DLLs, etc. do not have a .lib and therefore cause linker to barf when looking for this "dependent" lib.
Fix:
For the dependent project (B in above sample case), project settings, linker, general, set Ignore Import Library to Yes.
5.08.2003
.NET Application Updater Component Update components of a .NET application on the fly. Can manually look on servers for assemblies -- then download and replace on the fly -- maybe this avoids the security pitfalls (lessened abilities) of a full smart client ?
5.05.2003
.NET Client Web: The Official Microsoft Windows Forms Community Site WinForms stuff here - lots of samples, forums, articles, etc.
MSDN TV Episode Archive Page
See if this is any different from the .NET Show
IIS 6.0 and ASP.NET -- here
See if this is any different from the .NET Show
IIS 6.0 and ASP.NET -- here
Thanks to Mark Bidar (from realcode.com) for finding this .NET host. Digital Sense Hosting
Found it at FindMyHosting
Found it at FindMyHosting
5.01.2003
Include external appSettings in web.config
<configuration>
<appSettings file="myfile.config" />
</configuration>