Small fixes for web deploy
This commit is contained in:
@@ -65,7 +65,7 @@ namespace MileageTraker.Web.Controllers
|
||||
public JsonResult Exists(string vehicleId)
|
||||
{
|
||||
var vehicle = _ds.GetVehicle(vehicleId);
|
||||
return Json(vehicle != null ? true : false, JsonRequestBehavior.AllowGet);
|
||||
return Json(vehicle != null, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
public FileResult Export()
|
||||
|
||||
@@ -8,11 +8,11 @@ using MileageTraker.Web.Models;
|
||||
namespace MileageTraker.Web.DAL
|
||||
{
|
||||
public class MileageTrakerInitializer :
|
||||
#if DEBUG
|
||||
DropCreateDatabaseIfModelChanges<MileageTrakerContext>
|
||||
#else
|
||||
//#if DEBUG
|
||||
// DropCreateDatabaseIfModelChanges<MileageTrakerContext>
|
||||
//#else
|
||||
CreateDatabaseIfNotExists<MileageTrakerContext>
|
||||
#endif
|
||||
//#endif
|
||||
{
|
||||
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>
|
||||
@@ -35,7 +35,8 @@ namespace MileageTraker.Web.Utility
|
||||
// write column headers
|
||||
var properties =
|
||||
typeof(T).GetProperties()
|
||||
.Where(p => !p.PropertyType.IsCollection());
|
||||
.Where(p => !p.PropertyType.IsCollection())
|
||||
.ToList();
|
||||
|
||||
properties.Zip(
|
||||
CustomExtensions.GetNumbers(),
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace MileageTraker.Web.Utility
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
|
||||
public class FormatHintAttribute : Attribute
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public string Text { get; private set; }
|
||||
|
||||
public FormatHintAttribute(string text)
|
||||
{
|
||||
@@ -15,7 +15,7 @@ namespace MileageTraker.Web.Utility
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
|
||||
public class UnitsAttribute : Attribute
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public string Text { get; private set; }
|
||||
|
||||
public UnitsAttribute(string text)
|
||||
{
|
||||
@@ -27,22 +27,4 @@ namespace MileageTraker.Web.Utility
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -28,4 +28,9 @@
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
<log4net>
|
||||
<appender>
|
||||
<file xdt:Transform="SetAttributes" value="..\Logs\MileageTraker.log" />
|
||||
</appender>
|
||||
</log4net>
|
||||
</configuration>
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</configSections>
|
||||
<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>
|
||||
<appSettings>
|
||||
<add key="webpages:Version" value="1.0.0.0" />
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>4.0</OldToolsVersion>
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -359,6 +363,10 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Views\CreateLog\RecentLogs.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Properties\PublishProfiles\ETHRA.pubxml" />
|
||||
<None Include="Properties\PublishProfiles\Localhost.pubxml" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
||||
Reference in New Issue
Block a user