to enable IIS compression I use web config from:
Microsoft docs
I publish (self-contained/browser-wasm) to IIS with web deploy and Visual Studio replaces every time web.config with the default version.
I tried to add web.config from docs in my project so it should be merged at publish time, but the file doesn't appear in output folder and in IIS website i have only wwwroot folder.
where am i wrong?
how to automatically publish the right web.config file?
Found the problem:
IIS
Section "Use a custom web.config"
Added to project file:
<PropertyGroup>
<PublishIISAssets>true</PublishIISAssets>
</PropertyGroup>
Related
I have two ASP.Net Project. Project A is an earlier/older version of Project B. I used the publish functionality of Visual Studio to publish the .web project to Azure. Project A seems to get published successfully, and I can go to its Azure website in Chrome. But project B seems to succeed but when I browse to its site, I get a default Azure page stating "Your App Service is up and running".
Within Azure, I then go to Project B -> Development Tools -> Console and I simply enter ls to list the root directory contents. I simply get hostingstart.html.
When I do the same with Project A, I get: App_Readme Content Global.asax Images NewImages Scripts Views Web.config bin favicon.ico hostingstart.html packages.config
When I did the publish, I had Visual Studio running in Administrator Mode.
Also when I use IIS Express to locally deploy/publish, both sites load up and work fine.
I did not originally work on the two Projects. I simply inherited them, so I wouldn't know what was changed between A and B.
Is there something I have to enable in Project B to allow all the required files to be included in the publish?
In my Visual Studio 2015 MVC 5 web application, I'm deploying to Azure using publishing profile. In the publishing wizard, under settings, I have selected the Release build configuration and checked the "Remove additional files at destination" under File Publishing options.
When I'm done the publishing or even in preview mode it always deleting a view from the destination, instead of updating. It was never being published to the destination via the wizard, so I have FTP the cshtml file using FileZilla.
I have tried re-creating the publishing profile, but it works same as before. How do I include this file to be published as other files does?
I have found the issue. In that specific file I looked for properties windows for any uncommon setting with same file types, and I found that Build Action setting was set to None while other files have set to Content. After that the file getting deleting issue solved.
When deploying an Azure worker role project from Visual studio, everything works fine.
When we build the package using command line msbuild, the apps.config is not copied to project.dll.config.
How can we achieve that?
Note:
the msbuild command builds a cspkg file (which is a zip).
When we open the zip file, project.dll.config is not here.
Config: Visual studio 2013
azure sdk 2.3
Note 2:
When you create an azure solution in visual studio, it creates 2 project:
One Azure project.
One worker role project.
This is the Azure project that is built, and the app.config belongs to the worker role project.
Deploying through Visual studio makes the magic automatically, msbuild.exe does not ( or we don't know how to do it).
Is the App.config correctly specified in your .csproj file? You should have something similar to:
<Content Include="app.config">
<SubType>Designer</SubType>
</Content>
Somewhere in your .csproj file.
I have SlowCheetah as part of my TeamCity build process to transform app.config files.
I know that in the case of web applications, running an application in local Visual Studio debugger does NOT transform the relevant web.config. I presumed this behaviour was the same for app.config files but I just found today that when I run a Console or Windows Service application from local VS 2012 (e.g. in Debugger) the app.config is transformed.
Is there a way to prevent the app.config transform occurring when running a non-WAP project in debugger?
There is an easy way to do this.
Open the csproj file for the project (e.g. Windows Service project) in an editor (You can do right-click|Unload Project in the VS Solution Explorer followed by "Edit Project File" to edit the file contents in Visual Studio).
Look for the line containing the following:
<Import Project="$(SlowCheetahTargets)" Condition="Exists('$(SlowCheetahTargets)')" Label="SlowCheetah" />
and modify it as follows:
<Import Project="$(SlowCheetahTargets)" Condition="Exists('$(SlowCheetahTargets)')and '$(IsDesktopBuild)' == 'false'" Label="SlowCheetah" />
This will disable transforms when you are on your local machine but they will continue to be transformed in a Build Server.
I setup my first Azure Cloude Service as well as Web Role. When I build and then publish application I can only see bin directory with all my dlls. I don't have any folders or aspx files.
\ProjectName.CloudService\bin\Debug\ProjectName.CloudService.csx\roles\Web\bin
How can I compile other files.
Are the .aspx files actually added to the Visual Studio project? (Visual Studio only copies the files it knows about.) If you don't see them in the treeview for the project, click the button at the top that shows files not part of the project, and then right-click and "include in project" on the files you're missing.
If that doesn't work, you might consider heading over to the MSDN forum for Windows Azure: http://social.msdn.microsoft.com/forums/en-us/windowsazure/threads and asking there.
If you look in your Cloud Service project folder, you won't find the aspx files, dlls, etc. The Cloud Service project folder will only contain your configuration files and eventually your packaged Azure deployment files. You'll want to look in bin\Debug\ folder under your Web Role (ASP.NET) project.