首页 新闻 会员 周边 捐助

.net core 在centos7.1下运行报错: Illegal characters in path.

0
[已解决问题] 解决于 2016-09-29 15:03

2016-09-29 11:55:48.223 ERROR : System.ArgumentException: Illegal characters in path.
Parameter name: path
at System.IO.PathInternal.CheckInvalidPathChars(String path)
at System.IO.Path.Combine(String path1, String path2)
at System.IO.UnixFileSystem.FileSystemEnumerable`1.<Enumerate>d__11.MoveNext()
at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
at System.IO.FileSystemWatcher.RunningInstance..ctor(FileSystemWatcher watcher, SafeFileHandle inotifyHandle, String directoryPath, Boolean includeSubdirectories, NotifyEvents notifyFilters, CancellationToken cancellationToken)
at System.IO.FileSystemWatcher.StartRaisingEvents()
at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Web.Startup..ctor(IHostingEnvironment env)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.AspNetCore.Hosting.Internal.StartupLoader.LoadMethods(IServiceProvider services, Type startupType, String environmentName)
at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c__DisplayClass1_0.<UseStartup>b__1(IServiceProvider sp)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureStartup()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at Web.Program.Main(String[] args)

Qingben的主页 Qingben | 初学一级 | 园豆:184
提问于:2016-09-29 12:44
< >
分享
最佳答案
1

运行dotnet run命令的当前路径是什么?

奖励园豆:5
dudu | 高人七级 |园豆:29570 | 2016-09-29 14:07

/usr/bm/bm

Qingben | 园豆:184 (初学一级) | 2016-09-29 14:10

@Qingben: bm中有没由文件夹名或者文件使用了特殊字符,比如双引号

dudu | 园豆:29570 (高人七级) | 2016-09-29 14:13

@dudu: 没有, 里面只有我发布的程序文件

Qingben | 园豆:184 (初学一级) | 2016-09-29 14:15

找到问题了,是因为我有个json文件是中文名称导致的。

Qingben | 园豆:184 (初学一级) | 2016-09-29 15:03

@Qingben: 能具体写麽  我跟你遇到一样的错误,但是我没有啥json文件呢

文青 | 园豆:202 (菜鸟二级) | 2017-12-06 14:19
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册