Why can't I publish my web site in VS2017? - visual-studio-2017

When I try to publish my ASP.Net MVC web site, I get the following page:
The lonely looking Publish button does nothing.
Any ideas how I fix this?

I had similar problem and it solved by changing csproj file:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
changed to
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" Condition="true" />
This only works of course if you're trying to update an older project to the newer VS2017 environment.

Related

how to change .vs\config\applicationhost.config once and for all?

I have an ASP.Net MVC web application. When i initially created the project i specified it as a windows authentication. After some experimentation and development, the requirements shifted away from windows authentication, so i reconfigured the solution/web config etc. to allow anonymous authentication, and to disable windows authentication. However, i seem to have missed something somewhere along the way.
My web application now works great when i publish it, but i am constantly needing to edit the .vs\config\applicationhost.config file.
The config file defaults to the following state whenever i open the solution in visual studio:
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
These edits are required to get my ctrl+F5 functionality to work, each time i open the project in visual studio 2017.
At this stage i am not exactly sure, whether i should be looking at some setting in visual studio or perhaps IIS Express, so any help would be greatly appreciated!
I received the following communication from Bill H. at Microsoft which resolved the issue, sharing here in case anyone else encounters this problem:
"The value is stored in the project file so that it can be applied when you first download/clone a project. You can change the value in the property grid - select the project and press F4 to see the property grid"

Bug: VS 2017 ASP.NET Core app published to IIS [same machine]

First creating a new project in VS 2017 with template of ASP.NET Core (and individual authentication) does not have a web.config; yet is added upon publishing the app to C:\inetpub\wwwroot (on new install of Window server 2016, and VS on same machine).
When published, it fails to open a web page giving a "500 - Internal server error" page display. Going into IIS Manager after clicking on mySite in left panel, trying to click on anything in the middle panel for the hosted web site fails to open with this error:
As you can also see it gives no information into the actual error.
So not sure why it's looking to \\?\C: for the web.config file? I believe if I can get help resolving this the web page should load; as it does load in development. As stated this issue is occurring on just deployment of a basic ASP.NET Core template; but it also is doing the same thing with my previous web site created with VS 2015 Community ported over to VS 2017 (with required update to it by VS)
The web.config file, which is only in the published app folder and not the development project folders, is:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Laier-IT.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
This type of issue is typical of an IIS configuration that is not configured for .Net Core.
In order to host .Net Core applications in IIS it is necessary to install the .NET Core Windows Server Hosting bundle.
For detailed instructions on installing the .Net Core Windows Server Hosting bundle checkout the Microsoft documentation on installing .Net Core Windows Server Hosting.
This document also provides extensive information on deploying .Net Core to IIS and various other HTTP Servers.
Additionally you need to set the .Net CLR to no managed code in the application pool settings:

RESTful urls in ColdFusion 11

I just moved my CFWheels app from CF9 to CF11 and I've lost the REST urls from my previous setup.
For example before I had example.com/controller/view and now I get example.com/index.cfm?controller=foo&action=bar
The weird thing is that when I hardcode the url in it doesn't convert it or throw an error.
Is there a setting in the administrator's panel that I should check? I did a comparison with my previous setup but I have't found anything.
This is what I did to get it to work.
I uncomented the xml code inside web.config in the root of my application. Set the <directoryBrowse enabled="true" /> renamed the htaccess and ISAPIrewrite4.ini. Then restarted the server and Coldfusion through services.
I think the trick happened when I renamed the two files that were unnecessary for my setup (htaccess for apache and ISAPI rewrite for IIS 6).
Good luck to anyone running through this issue :)

Check If Sitecore is a MVC installtion

Is there a easy way to find out if a Sitecore installation on the server includes MVC?
I am a total Sitecore beginner and have to migrate ASP.NET Forms to MVC.
Best regards
Check if Sitecore.MVC.config is there in App_Config\Include folder.
Or open http://.../sitecore/admin/showconfig.aspx url. See if MVC settings are there.
E.g.:
<sitecore>
<pipelines>
<mvc.getRenderer>

SlowCheetah Transformations are not being performed on Unit Test project during Continuous Integration Build on TFS 2013

I've been searching Google, reading various questions (and answers) here on Stack Overflow, and scanning the SlowCheetah NuGet page, the GitHub issues list, and the utility author's blog, and I still can't find an answer to figure out exactly what's causing my problems.
I have a solution hosted in a TFS 2013 Git repository. When a particular branch is pushed to the TFS server, it kicks off an automated build and deployment to a build site. All of that is working great. It also kicks off all of the unit tests and everything runs without issue.
That is, until I get to the SpecFlow WatiN tests...
The tests get kicked off without an issue, and I have the server set up to run the WatiN tests interactively within the browser. That all works. The problem is that the site the WatiN tests hit are on the Build server, which is a different URL than what I use locally on my development box (and also from the testing server, which is a third URL). I have the site URL set up in the App.Config of the unit test project (which is an MSTest-based project). I also have XDT transformation files set up for each of our target environments, including the Build environment in question.
When I do a push to TFS, or manually start a build, everything runs fine until it gets to the SpecFlow tests. These particular tests start, and if I'm actually logged into the VM-hosted server that acts as the build server when the build and tests are running AS THE Build/Test user, I can actually see the browser start up. I can also see, briefly, the "This page can’t be displayed" message in Internet Explorer, which is not the expected behavior (I should see the app's login page) and the test fails.
Looking at it a bit further, I started with the obvious - is it hitting the right site? Well, digging into the build folder on the server, I was able to verify that the transformation is NOT working - the app.config file has the site URL for the development machine and not the one for the Build environment!
The transformations for the web project ARE working - the changes for the Build environment are being populated for the front-end web application and the back-end service tier application and they work - I can bring up the site on the build server in a browser. But these projects are not using SlowCheetah, but rather the build-in web.config transformations. The unit test project DOES have the SlowCheetah NuGet package installed; it just doesn't seem to be working for whatever reason.
Here's the app.config file for the unit test project in question:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
</configSections>
<appSettings>
<add key="SiteUrl" value="http://dev.server.url/" />
</appSettings>
<!-- Spec-Flow Configuration -->
<specFlow>
<unitTestProvider name="MsTest" />
</specFlow>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.5022.0" newVersion="2.0.5022.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
The configuration transformation file app.Build.config is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="SiteUrl" xdt:Locator="Match(key)" xdt:Transform="SetAttributes" value="http://build.server.url/" />
</appSettings>
</configuration>
These configuration files look OK to me, so I don't think there's an issue with the format of the files. I can also verify that the SpecFlow tests run and pass when I run them manually on my local development box. My guess is that either the transformation simply isn't being kicked off, or maybe there's something in the timeline of when the transformations are run and when the unit tests are run.
What am I doing wrong here? Any assistance is greatly appreciated!
In your Build Definition you probably defined the Configurations to use. Part of that also defines a Platform like Any CPU or x86. As it turns out in the solution the Platform Any CPU has a space where in the project files the Platform AnyCPU does not have a space.
I found the best way to get around this was to leave the Platform blank and only put in the configuration name. VS will pop up a warning letting you know that there is data missing, you can just hit Yes to save it anyways. Alternatively you can just type in your configurations like the following |Release,|Debug.
The pattern is [PlatformName]|[ConfigurationName],[PlatformName]|[ConfigurationName],...