NuGet.Config is malformed, Please check NuGet.Config - solution - nuget

After installing Update1 for VS 2015 I had a problem when trying to add local path for Nuget Manager.
Message was:
"NuGet.Config is malformed, Please check NuGet.Config"
In my case it was enough to find a nuget.config in path:
C:\Users\_my_user_name_\AppData\Roaming\NuGet\
Nuget.config file was empty (but size was 1KB).
I just filled it with content:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
</configuration>
And problem in VS didn't appear again.

In my case, %appdata%\nuget\nuget.config existed and was populated,... but its xml header claimed utf-8 when the file was really encoded fully-Unicode. Saving as utf-8 bom got me going again.

Related

(PowerShellForGitHub) PowerShell Set-GitHubContent messes up the encoding of the csproj file

Greeting all,
I wonder if someone encountered similar issue or knows the solution to that problem:
I am using PS module PowerShellForGitHub to perform some work in my github repositories.
One of actions is to make changes to the net standard project file.
For that the function Set-GitHubContent is used.
After I push up the changes the project file becomes unreadable by VisualStudio with the error
error : The project file could not be loaded. Name cannot begin with the '.' character, hexadecimal value 0x00. Line 1, position 2.
Clearly the encoding issue as the file is opened fine by notepad and looks good.
I cant figure out how the issue is happening.
I tried a very simple code
$test=#'
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Configurations>Debug;Release;AllInOne</Configurations>
</PropertyGroup>
</Project>
'#
Set-GitHubContent -OwnerName 'aa' -RepositoryName "RepName" -Path "ProjectFile.csproj" -CommitMessage "any" -Content "$test" -BranchName "main"
and even that code messes up the project file.
Any ideas what is going on?
Thanks,
Arbus

Jenkins Plugin for Writing to the Change Log?

Does anyone know of a Jenkins plugin which will allow you to easily set your own values for the "Changes" portion of a build?
We're manually performing our own SCM syncs, and so we don't currently have access to or know how to change the "Changes" portion of the build status.
Thank you for your help!
There is no specific plugin to do it.
Each builds change log is saved in a location like "C:\Program Files (x86)\Jenkins\jobs\BuildJobName\builds\2014-09-11_21-30-25\changelog.xml"
You can manually edit it or write an app which edits the changelog.xml
The format of the changelog.xml is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<log>
<logentry revision="16349">
<author>LeoN</author>
<date>2014-10-24T08:33:57.708042Z</date>
<paths>
<path action="M" localPath="Binaries\Plugins\product.wxs" kind="file">/trunk/Project Phases/Development/Binaries/Plugins/product.wxs</path>
<path action="M or D or A" localPath="LocalPath From repo" kind="dir or File">Svn Path</path>
</paths>
<msg> Fixed Issues.</msg>
</logentry>
</log>
Action attribute can have values such as M,D,A
M - Modifications
D - Deletes
A - File or folder additions
I suggest you write an app to do this.

EntityDeploySplit error - Microsoft.Data.Entity.Build.Tasks.dll missing

After a clean Windows reformat and installing Visual Studio 2013, trying to build a project with database-first Entity Framework edmx files yields the following error:
The "EntityDeploySplit" task could not be loaded from the assembly
C:\Program Files
(x86)\MSBuild\12.0\bin\Microsoft.Data.Entity.Build.Tasks.dll. Could
not load file or assembly 'file:///C:\Program Files
(x86)\MSBuild\12.0\bin\Microsoft.Data.Entity.Build.Tasks.dll' or one
of its dependencies. The system cannot find the file specified.
Confirm that the declaration is correct, that the assembly
and all its dependencies are available, and that the task contains a
public class that implements Microsoft.Build.Framework.ITask.
Is there some way to install this separately? What is this assembly included with by default?
UPDATE: This also manifests itself when looking for the EntityClean task. I'm inclined to think that it checks the bin first, since another developer who was running it fine tried a clean / rebuild and then this started showing up.
I found the accepted answer to be a little confusing, below are the steps that worked for me.
Open C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Data.Entity.targets in notepad.
Alter the UsingTask elements to:
<UsingTask TaskName="EntityDeploySplit"
AssemblyFile="Microsoft.Data.Entity.Build.Tasks.dll" />
<UsingTask TaskName="EntityDeploy"
AssemblyFile="Microsoft.Data.Entity.Build.Tasks.dll" />
<UsingTask TaskName="EntityDeploySetLogicalNames"
AssemblyFile="Microsoft.Data.Entity.Build.Tasks.dll" />
<UsingTask TaskName="EntityClean"
AssemblyFile="Microsoft.Data.Entity.Build.Tasks.dll" />
I ran into this problem and was able to fix it as I have described below. Your paths and variables may be different.
I found that when my project builds it points to this target file:
C:\Program Files (x86)\MSBuild\12.0\Bin\Microsoft.Data.Entity.targets
That target file appears to just be a placeholder. There is an Import element, in that file, that points to $(MSBuildFrameworkToolsPath)\Microsoft.Data.Entity.targets which runs the target file located at that path. I searched registry and found that MSBuildFrameworkToolsPath is a registry entry with the value of C:\Windows\Microsoft.NET\Framework\v4.0.30319\
I went to the targets file that was referenced and search for the UsingTask element that was specified in my exception. Inside the UsingTask element, the AssemblyFile attribute was pointed to $(MSBuildBinPath)\Microsoft.Data.Entity.Build.Tasks.dll. I searched the registry and found that the MSBuildBinPath registry entry was pointed to c:\Windows\Microsoft.NET\Framework\v3.5\
I'm not sure why it was pointed to that, maybe a Framework or Visual Studio installation didn't clean it up. Finally, I changed all my UsingTask elements' AssemblyFile attributes to:
$(MSBuildFrameworkToolsPath)\Microsoft.Data.Entity.Build.Tasks.dll
I used the same variable that was in the MSBuild Bin target file.
Hope this helps.
I give a lot of credit to Andy Mahaffey for his answer, without it I would not have found what I did.
I followed along his line of research but didn't like the idea of just changing the UsingTasks' attributes. I opened up the "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Data.Entity.targets" file and I found the first thing it says after the opening Project element is this comment:
<!-- This .targets file can be used by updating Microsoft.Common.targets to
include the line below (as the last import element just before the end project tag)
<Import Project="$(MSBuildBinPath)\Microsoft.Data.Entity.targets" Condition="Exists('$(MSBuildBinPath)\Microsoft.Data.Entity.targets')"/>
-->
I followed it's suggestion and presto, problems solved.
I hope this helps!
TLDR
Paste the line below as the last element before the tag in the following file. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets
<Import Project="$(MSBuildBinPath)\Microsoft.Data.Entity.targets" Condition="Exists('$(MSBuildBinPath)\Microsoft.Data.Entity.targets')"/>
In my case, I had accidentally created two copies of one of my .edmx files, one in a subfolder, where I didn't notice it. Once I deleted the extra one, everything was fine.

Eclipse Content is not allowed in prolog

I'm having trouble opening my main in my eclipse project. It keeps coming up with:
"content is not allowed in prolog"
I haven't altered my code or anything.
I have no idea what has gone wrong, anybody seen this before?
I had the same error and figured it out.
When I tried to create a new string resource, I tried to paste the new resource value on the "Android Resources" screen. To my surprise, the paste operation (using CTRL + V) does not work on that screen, and I tried it several times.
After that I started getting the error. When I switched from the "Android Resources" screen to the raw XML screen of the Strings.xml file, I noticed that all the text that I tried to paste was at the beginning of the file, like this:
Image content description. Image content description.<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My App</string>
</resources>
And that was causing the error for me.
This error is generated during parsing of an XML document. Here is one writeup:
http://www.mkyong.com/java/sax-error-content-is-not-allowed-in-prolog/
You didn't provide sufficient information in your question to know which file might be corrupted, but search for xml files in your project and see if they look ok.
Restarting Eclipse and Cleaning the problem dint help.
I opened the .xml file in a XML editor and did a Validate on that error alone. this solved my problem. Hope this helps for people who still got the problem
Its most likely an encoding problem: (edit in notepad++ and select) encoding utf-8 -BOM
I had the same problem, It may be because of XML parser issue,
I restarted the eclipse it started working fine.
I also had the same error.Check your Xml files.There may be syntax error in xml files.
Having incorrect encoding information might cause this.
<?xml version="1.0" encoding="utf-16"?>
at the top of an ascii or utf-8 encoded file for example.
Yeah, I had the same, and the first line in strings.xml:
<?xml version="1.0" encoding="utf-8"?>
was marked with this error. Though I also didn't alter any code, yesterday, when I closed Eclipse, everything was fine, no errors (though some warnings were present, but that doesn't matter, I think)
All I did now is Selecting this line, Ctrl+X (Cut) it, Ctrl+S to save, Ctrl+V (Paste) it back and Ctrl+S again, and the error is gone. Not sure if it will work for everybody, but it did for me 8)
Check: that you have no any additional wrong text before in the beginning of file.
In my case I was seeing those error in java classes i.e. NOT XML and, the problem was related to a hidden file called .springBeans in the main project directory. I had a section "configs" and "autoconfigs" like:
java:org.DDDDDDDDDD.config.PersistenceConfig
java:org.DDDDDDDDDD.core.Application
When i moved everything to autoconfigs it all worked for me
In my case, server.xml got corrupted.
Go to pivotal/tomcat server location.
Path : base-instance\conf
File Name: server.xml
So i tried replacing below content in that file and it worked fine.
Sample content:-
<?xml version="1.0" encoding="UTF-8"?>
<Server port="${base.shutdown.port}" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<Listener className="com.springsource.tcserver.serviceability.deploy.TcContainerDeployer"/>
<Listener accessFile="${catalina.base}/conf/jmxremote.access" address="127.0.0.1" authenticate="true" className="com.springsource.tcserver.serviceability.rmi.JmxSocketListener" passwordFile="${catalina.base}/conf/jmxremote.password" port="${base.jmx.port}" useSSL="false"/>
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
<Executor maxThreads="300" minSpareThreads="50" name="tomcatThreadPool" namePrefix="tomcat-http--"/>
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" deployOnStartup="true" deployXML="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
</Host>
</Engine>
<Connector acceptCount="100" connectionTimeout="20000" executor="tomcatThreadPool" maxKeepAliveRequests="15" port="${nio.http.port}" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectPort="${nio.https.port}"/>
</Service>
</Server>
I had a similar issue and wanted to make a note, in case other had the same root cause that I did.
My issue was related to the xsi:schemaLocation. The url stated was no longer being served. Via googling, I got a copy of the actual xsd file, which I included locally then updated the reference. This solved my issue.
e.g. http://dozer.sourceforge.net/schema/beanmapping.xsd became beanmapping.xsd in the snippet below, after adding the .xsd file to the same folder.
<?xml version="1.0" encoding="UTF-8"?>
<mappings xmlns="http://dozer.sourceforge.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://dozer.sourceforge.net beanmapping.xsd">
i delete the c:/users/your_computer/appdata/.gradle/cache and it went go to normal
I fix it with a non - xml file by clearing the file in the text editor, save the empty file and paste it back. (CTRL+A, CTRL+X, CTRL+S, CTRL+V, CTRL+S)

.NET 2.0 app on Windows Server 2003 doesn’t load a .config file

I can’t made my .NET 2.0 applications (and services) to load their appname.exe.config files on Windows Server 2003 Standard Edition SP2,
I tried to create manifest like this but it didn’t worked
EDIT:
Appname.config is located in the same dir,
App works without any changes on Windows XP, once we move files or use setup to install it on 2003 it fails to load .config file.
The "working directory" of the executable IS the same as it's path! We didn’t change anything while moving it from XP to 2003
I’ve tried process monitor, it says for operations CreateFile and QueryOpen: name not fount, like this file would not exists, but I assure, it is!
I think it might be something wit manifest files under 200, according to this thred on MS Connect
but I don’t know how to solve the problem.
This might be the solution:
http://blogs.msdn.com/junfeng/archive/2006/08/09/692996.aspx
To workaround the bug, add an assemblyIdentity to the SxS manifest.
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
name="Foo"
type="win32"
/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Two things come to mind:
First, is the config file located in the same directory as the executable?
Second, is the "working directory" of the executable the same as it's path? If the working directory isn't correct, then it won't be able to locate the file.
One more thing to do would be to get a copy of sysinternals, specifically the process explorer tool to see what file (and path) it's trying to load.
What do you mean by cannot load? Any exception message .Net throws at you? Or it just dies silently?
Your app should load yourexe.exe.config, i.e., mainform.exe.config, where mainform.exe is your app name.