CopyTimer fails to run

Dec 18, 2007 at 1:54 PM
Ran the application on two different XPSP2 machines and receive same error. See below:

Unhandled Exception: System.TypeInitializationException: The type initializer
for 'CopyTimer.Program' threw an exception. ---> System.Security.SecurityException
: Request for the permission of type 'System.Security.Permissions.SecurityPermission,
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Net.ServicePointManager.set_CertificatePolicy(ICertificatePolicy value)
at CopyTimer.Utility..ctor()
at CopyTimer.Program..cctor()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The first permission that failed was:
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Flags="UnmanagedCode"/>

The demand was for:
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Flags="UnmanagedCode"/>

The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet" version="1">
<IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Read="USERNAME"/>
<IPermission class="System.Security.Permissions.FileDialogPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Read="c:\WAN\testing\SharepointCopyTimer\"
PathDiscovery="c:\WAN\testing\SharepointCopyTimer\"/>
<IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, m
scorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Allowed="AssemblyIsolationByUser"
UserQuota="9223372036854775807"
Expiry="9223372036854775807"
Permanent="True"/>
<IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Flags="ReflectionEmit"/>
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Flags="Assertion, Execution, BindingRedirects"/>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=
2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Url="file:///c:/WAN/testing/SharepointCopyTimer/CopyTimer.exe"/>
<IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib
, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1"
Zone="Intranet"/>
<IPermission class="System.Net.DnsPermission, System, Version=2.0.0.0, Culture=
neutral, PublicKeyToken=b77a5c561934e089" version="1"
Unrestricted="true"/>
<IPermission class="System.Drawing.Printing.PrintingPermission, System.Drawing,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" version="1"
Level="DefaultPrinting"/>
</PermissionSet>

The assembly or AppDomain that failed was:
CopyTimer, Version=1.0.2873.22324, Culture=neutral, PublicKeyToken=null
The Zone of the assembly that failed was:
Intranet
The Url of the assembly that failed was:
file:///c:/WAN/testing/SharepointCopyTimer/CopyTimer.exe
--- End of inner exception stack trace ---
at CopyTimer.Program.Main(String[] args)

I ran the copytimer.exe as both a regular user and as administrator. Any assistance is welcome and appreciated.
Dec 18, 2007 at 2:02 PM
Appears that running from local drive works fine. I originally ran from a network drive and that is when the process failed.
Dec 18, 2007 at 2:36 PM
Edited Dec 18, 2007 at 2:37 PM
Test runs fine but results are not uploaded to website results folder. Receive the following error message:

System.Net.WebException: The request failed with HTTP status 404: Not Found.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse
(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at CopyTimer.ResultsList.Lists.UpdateListItems(String listName, XmlNode updates)
at CopyTimer.Program.SaveResults(String ResultsListName)

Note that I am testing this on WSS 3.0.
Dec 18, 2007 at 3:43 PM
Modified config file to point to root of website for list. Now receive:

Error:
<Result ID="1,New" xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<ErrorCode>0x81020014</ErrorCode><ErrorText>One or more field types are not installed p
roperly. Go to the list settings page to delete these fields.</ErrorText></Result>

Config file below:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="CopyTimer.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<CopyTimer.Properties.Settings>
<!--Doc Lib Url should be a path to a SharePoint doc lib with the files File1-File3 located in the library-->
<setting name="DocLibUrl" serializeAs="String">
<value>http://team.corp.com/Library/wan/statistics/copytimer/files/</value>
</setting>
<!--File1-File3 are file names which are located in the Doc Lib Url-->
<setting name="File1" serializeAs="String">
<value>File1.doc</value>
</setting>
<setting name="File2" serializeAs="String">
<value>File2.doc</value>
</setting>
<setting name="File3" serializeAs="String">
<value>File3.doc</value>
</setting>
<!-- The following Web Service paths should be updated to point to the site where results are stored-->
<!-- This can be the same or different from the site being used for tests-->
<setting name="CopyTimerResultsListLists" serializeAs="String">
<value>http://team.corp.com/vtibin/lists.asmx</value>
</setting>
<setting name="CopyTimerResultsViewViews" serializeAs="String">
<value>http://team.corp.com/vtibin/views.asmx</value>
</setting>
<!-- The name of the List which will hold CopyTimer's results from clients. -->
<!-- It will be created if it doesn't exist, in the location used for the above Web Services-->
<setting name="ResultListName" serializeAs="String">
<value>CopytimerResultsList</value>
</setting>
</CopyTimer.Properties.Settings>
</applicationSettings>
</configuration>
Coordinator
Jan 25, 2008 at 7:36 AM
Edited Jan 25, 2008 at 7:39 AM
don't know if you figured it out but looking at your last post your config says:

http://team.corp.com/vtibin/views.asmx

It should have underscores and point to the actual site, not the root site (unless that's where you really meant to write results to):
http://team.corp.com/sites/siteiwanttowriteto/_vti_bin/views.asmx
http://team.corp.com/sites/siteiwanttowriteto/_vti_bin/lists.asmx

give that a try for both ResultsList and ResultsView

it may have been codeplex formatting that messed up your config file though. also make sure the user running the app has full perms on the library you are testing from and writing results to. (it can be two different places)