Small fixes for web deploy

This commit is contained in:
2012-12-04 14:04:29 -05:00
parent 820b766ed5
commit 0411e4c814
9 changed files with 65 additions and 27 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ namespace MileageTraker.Web.Controllers
public JsonResult Exists(string vehicleId) public JsonResult Exists(string vehicleId)
{ {
var vehicle = _ds.GetVehicle(vehicleId); var vehicle = _ds.GetVehicle(vehicleId);
return Json(vehicle != null ? true : false, JsonRequestBehavior.AllowGet); return Json(vehicle != null, JsonRequestBehavior.AllowGet);
} }
public FileResult Export() public FileResult Export()
+4 -4
View File
@@ -8,11 +8,11 @@ using MileageTraker.Web.Models;
namespace MileageTraker.Web.DAL namespace MileageTraker.Web.DAL
{ {
public class MileageTrakerInitializer : public class MileageTrakerInitializer :
#if DEBUG //#if DEBUG
DropCreateDatabaseIfModelChanges<MileageTrakerContext> // DropCreateDatabaseIfModelChanges<MileageTrakerContext>
#else //#else
CreateDatabaseIfNotExists<MileageTrakerContext> CreateDatabaseIfNotExists<MileageTrakerContext>
#endif //#endif
{ {
private const string CreateIndex = "CREATE NONCLUSTERED INDEX [IDX_{1}] ON [{0}] ([{1}])"; private const string CreateIndex = "CREATE NONCLUSTERED INDEX [IDX_{1}] ON [{0}] ([{1}])";
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>Package</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<DesktopBuildPackageLocation>C:\Users\poprhythm\Documents\code\PublishPackages\MileageTraker.zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>Default Web Site</DeployIisAppPath>
<PublishDatabaseSettings>
<Objects xmlns="">
<ObjectGroup Name="MileageTrakerContext" Order="1" Enabled="True">
<Destination Path="Data Source=mileage;Initial Catalog=MileageTraker;User ID=MileageTrakerUser;Password=qwerty;Connect Timeout=60" Name="Data Source=mileage;Initial Catalog=MileageTraker;User Id=MileageTrakerUser;Password=qwerty;Connect Timeout=60" />
<Object Type="DbCodeFirst">
<Source Path="DBMigration" DbContext="MileageTraker.Web.Models.MileageTrakerContext, MileageTraker" MigrationConfiguration="MileageTraker.Web.Migrations.Configuration, MileageTraker" Origin="Configuration" />
</Object>
</ObjectGroup>
</Objects>
</PublishDatabaseSettings>
</PropertyGroup>
<ItemGroup>
<MSDeployParameterValue Include="$(DeployParameterPrefix)MileageTrakerContext-Web.config Connection String">
<ParameterValue>Data Source=mileage;Initial Catalog=MileageTraker;User Id=MileageTrakerUser;Password=qwerty;Connect Timeout=60</ParameterValue>
</MSDeployParameterValue>
</ItemGroup>
</Project>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<publishUrl>C:\inetpub\MileageTraker</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>
+2 -1
View File
@@ -35,7 +35,8 @@ namespace MileageTraker.Web.Utility
// write column headers // write column headers
var properties = var properties =
typeof(T).GetProperties() typeof(T).GetProperties()
.Where(p => !p.PropertyType.IsCollection()); .Where(p => !p.PropertyType.IsCollection())
.ToList();
properties.Zip( properties.Zip(
CustomExtensions.GetNumbers(), CustomExtensions.GetNumbers(),
+2 -20
View File
@@ -5,7 +5,7 @@ namespace MileageTraker.Web.Utility
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class FormatHintAttribute : Attribute public class FormatHintAttribute : Attribute
{ {
public string Text { get; set; } public string Text { get; private set; }
public FormatHintAttribute(string text) public FormatHintAttribute(string text)
{ {
@@ -15,7 +15,7 @@ namespace MileageTraker.Web.Utility
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class UnitsAttribute : Attribute public class UnitsAttribute : Attribute
{ {
public string Text { get; set; } public string Text { get; private set; }
public UnitsAttribute(string text) public UnitsAttribute(string text)
{ {
@@ -27,22 +27,4 @@ namespace MileageTraker.Web.Utility
public class NoEditLabelAttribute : Attribute public class NoEditLabelAttribute : Attribute
{ {
} }
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class RenderModeAttribute : Attribute
{
public RenderMode RenderMode { get; set; }
public RenderModeAttribute(RenderMode renderMode)
{
RenderMode = renderMode;
}
}
public enum RenderMode
{
Any,
EditModeOnly,
DisplayModeOnly
}
} }
+5
View File
@@ -28,4 +28,9 @@
</customErrors> </customErrors>
--> -->
</system.web> </system.web>
<log4net>
<appender>
<file xdt:Transform="SetAttributes" value="..\Logs\MileageTraker.log" />
</appender>
</log4net>
</configuration> </configuration>
+1 -1
View File
@@ -5,7 +5,7 @@
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections> </configSections>
<connectionStrings> <connectionStrings>
<add name="MileageTrakerContext" connectionString="Data Source=localhost;Initial Catalog=MileageTraker;User Id=MileageTrakerUser;Password=qwerty" providerName="System.Data.SqlClient" /> <add name="MileageTrakerContext" connectionString="Data Source=localhost;Initial Catalog=MileageTraker;Integrated Security=True;Connect Timeout=60" providerName="System.Data.SqlClient" />
</connectionStrings> </connectionStrings>
<appSettings> <appSettings>
<add key="webpages:Version" value="1.0.0.0" /> <add key="webpages:Version" value="1.0.0.0" />
+8
View File
@@ -21,6 +21,10 @@
<UpgradeBackupLocation> <UpgradeBackupLocation>
</UpgradeBackupLocation> </UpgradeBackupLocation>
<OldToolsVersion>4.0</OldToolsVersion> <OldToolsVersion>4.0</OldToolsVersion>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@@ -359,6 +363,10 @@
<ItemGroup> <ItemGroup>
<Content Include="Views\CreateLog\RecentLogs.cshtml" /> <Content Include="Views\CreateLog\RecentLogs.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Properties\PublishProfiles\ETHRA.pubxml" />
<None Include="Properties\PublishProfiles\Localhost.pubxml" />
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>