How to remove alert message from NuGetGallery - nugetgallery

I have installed NuGet on my machine, but I can't disable the Yellow Alert message "This is a development environment. No data will be preserved."
I have changed in my web.config this key
<add key="Gallery.Environment" value="Development" />
to
<add key="Gallery.Environment" value="Production" />
But it is still appearring... Any idea on where to look?

Delete file Alert.md from App_data folder

Related

Azure Devops Pipeline build on OFFLINE server - NuGet packages?

My solution builds perfectly on my local machine and it uses Microsoft.Data.Sqlclient and Azure.Core nuget packages, but the solution does NOT build on our Azure Devops server because there is no internet access there. The error is "Error NETSDK1064: Package Azure.Core, version 1.20.0 was not found."
I put these packages in a .packages subfolder and created a Nuget.config file that I believe references this sub-folder, but no luck.
How can I tell our DevOps server to use find the Nuget packages in the .packages subfolder?
I finally got this to work through the NuGet Restore task placed before the build. I chose "custom" as the NuGet Restore command type, and the actual command was:
restore CoreBZ2.sln -PackagesDirectory ..\packages
with ALL of the needed packages (all .nupkg files) in the "packages" subfolder of my solution. (CoreBZ2.sln is the name of my project/solution.)
I also had a NuGet.config file placed in the same folder as the solution and it looked like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value=".\packages" />
<add key="Azure.Core" value=".\packages" />
</packageSources>
<config>
<add key="globalPackagesFolder" value=".\packages" />
<add key="defaultPushSource" value=".\packages" />
</config>
<activePackageSource>
<add key="All" value=".\packages" />
</activePackageSource>
<config>
<add key="repositoryPath" value="$\..\packages" />
</config>
</configuration>
There is probably a better way to do this, but this did finally result in a successful build on the offline DevOps server.

How to define custom web.config in .Net Core 2 for IIS publish?

VS will generate (and override) a web.config file as part of publishing to IIS. I have various items I need to include in the file (like extending the file upload max size limit, redirecting to HTTPS, etc.). I am currently having to copy and paste the contents into the file after every publish.
Is there a way to define the contents of the web.config file that Visual Studio generates when publishing a .NET Core 2 web app for IIS?
not sure if you solved this, but if anyone else runs across this problem, I had this issue and finally went looking for the source code for the transform task. it contains some logging, so I ran the dotnet publish with a /v:n parameter, which sets the logging verbosity to "normal":
dotnet publish src\MyProject -o ..\..\publish /v:n
when I ran this, I saw this in the output:
_TransformWebConfig:
No web.config found. Creating 'C:\Development\MyProject\publish\web.config'
even though there is a web.config in the project. I changed the properties of the web.config "Copy to Output Directory" to "Always", and now the web.config in my project gets merged with the auto-generated contents.
my csproj now has this in it:
<None Include="web.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
and the publish output has:
_TransformWebConfig:
Updating web.config at 'C:\Development\MyProject\publish\web.config'
NOTE: if you are publishing to an existing directory that already has web.config in it, it will update that file. (i.e., an old publish). if you don't specify an output directory, it will publish to something like /bin/Debug/net471/publish/, which may have old files in it.
NOTE2: you still need the Sdk="Microsoft.NET.Sdk.Web" attribute on the Project node in your csproj file, or it won't even bother looking for Web.configs.
for reference, here is the task source code:
https://github.com/aspnet/websdk/blob/master/src/Publish/Microsoft.NET.Sdk.Publish.Tasks/Tasks/TransformWebConfig.cs
I finally got back to this and wound up using a transform:
Create a web.release.config file in the root of the project
Set that file's properties to Build Action = None so it doesn't get copied directly to the destination folder
Use the transformation syntax to define the sections that need to be inserted:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<location>
<system.webServer>
<security xdt:Transform="Insert">
<requestFiltering>
<requestLimits maxAllowedContentLength="209715200" />
</requestFiltering>
</security>
<rewrite xdt:Transform="Insert">
<rules>
<rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{SERVER_PORT_SECURE}" pattern="^0$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
<modules xdt:Transform="Insert" runAllManagedModulesForAllRequests="false">
<remove name="WebDAVModule" />
</modules>
</system.webServer>
</location>
</configuration>

Grial nuget package breaks build on mobile.azure.com

I recently added grial nuget packages to a xamarin solution.
It works fine locally but the build fails on mobile.azure.com.
I have used the nuget command line to add the new package source, including the credentials as a username / encrypted password.
It still breaks the build though, but this time with the error
"Data unprotection failed."
Has anyone come across this before, and do you have any possible solution?
thanks
You need to consider adding a nuget.config file. Below is an example that we used to include our Proget Feed.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="true" />
<add key="automatic" value="true" />
</packageRestore>
<packageSources>
<add key="NRTH Proget" value="http://proget.nrth.com/nuget/nuget" />
</packageSources>
</configuration>
Just drop this file in the same folder as your solution (.sln) file.

Visual studio 2013 view project in browser gives internal server error

I am new with Visual studio 2013 and I am currently working on two projects started by another developer. With one project the view option works fine using IIS Express, but the second one gives me error 500 with the below details...
"HTTP Error 500.19 - Internal Server Error. The requested page cannot be accessed because the related configuration data for the page is invalid."
"Config Error: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'Access-Control-Allow-Origin'"
Config Source:
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
Hope somebody knows about an error like this and how I can solve it. Thanx in advance
I suspect IIS is already sending an Access-Control-Allow-Headers by default and that is blowing up.
Typically when setting custom headers one usually does a prophalactic removal first:
<customHeaders>
<remove name="Access-Control-Allow-Origin" />
<remove name="Access-Control-Allow-Headers" />
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
</customHeaers>
This insures your app works no matter what happened upstream in configuration.

Implementing BlogEngine as an application within Umbraco

I have an installation of Umbraco v4.9.0 within which I am trying to get a working install of BlogEngine.NET v2.6.0.5
This is in IIS8 on a Windows 8 machine.
I have so far been able to set up BlogEngine within a sub folder and the application works just fine until I try to open a page with the cshtml extension.
The error i am getting is
This type of page is not served.
Description: The type of page you have requested is not served because
it has been explicitly forbidden. The extension '.cshtml' may be
incorrect. Please review the URL below and make sure that it is
spelled correctly.
Requested URL: /blog/admin/default.cshtml
Both web.configs have entries designed to prevent this error from happening.
Umbraco
<buildProviders>
<add extension=".cshtml"
type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" />
<add extension=".vbhtml"
type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" />
<add extension=".razor"
type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" />
</buildProviders>
BlogEngine
<buildProviders>
<remove extension=".cshtml" />
<add extension=".cshtml"
type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor"/>
</buildProviders>
I have the relevant MVC binaries in the respective bin folders and I've even tried adding request filtering instructions to both web.configs e.g
<requestFiltering>
<fileExtensions>
<add fileExtension=".cshtml" allowed="true" />
</fileExtensions>
</requestFiltering>
Have I missed something obvious?
Is your IIS site running in Classic or Integrated mode? Try switching to Integrated mode and see if that fixes your issue.

Resources